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

This commit is contained in:
Rob Shearman 2007-04-01 13:43:39 +01:00 committed by Alexandre Julliard
parent bc4bbb40d1
commit fd8868bac4

View File

@ -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);
}
}
}