urlmon: Fix a reference count leak that would keep the module alive when it shouldn't.

Robert Shearman rob at codeweavers.com
Sun Apr 1 07:43:39 CDT 2007


---
  dlls/urlmon/urlmon_main.c |    8 ++++++++
  1 files changed, 8 insertions(+), 0 deletions(-)
-------------- next part --------------
diff --git a/dlls/urlmon/urlmon_main.c b/dlls/urlmon/urlmon_main.c
index 3d29feb..0f12011 100644
--- a/dlls/urlmon/urlmon_main.c
+++ b/dlls/urlmon/urlmon_main.c
@@ -220,11 +220,19 @@ static void init_session(BOOL init)
     for(i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++) {
         if(object_creation[i].protocol) {
             if(init)
+            {
                 IInternetSession_RegisterNameSpace(session, object_creation[i].cf,
                         object_creation[i].clsid, object_creation[i].protocol, 0, NULL, 0);
+                /* make sure that the AddRef on the class factory doesn't keep us loaded */
+                URLMON_UnlockModule();
+            }
             else
+            {
+                /* make sure that the Release on the class factory doesn't unload us */
+                URLMON_LockModule();
                 IInternetSession_UnregisterNameSpace(session, object_creation[i].cf,
                         object_creation[i].protocol);
+            }
         }
     }
 


More information about the wine-patches mailing list