urlmon: Fix a reference count leak that would keep the module alive when it shouldn't.
This commit is contained in:
parent
bc4bbb40d1
commit
fd8868bac4
|
@ -220,13 +220,21 @@ static void init_session(BOOL init)
|
||||||
for(i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++) {
|
for(i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++) {
|
||||||
if(object_creation[i].protocol) {
|
if(object_creation[i].protocol) {
|
||||||
if(init)
|
if(init)
|
||||||
|
{
|
||||||
IInternetSession_RegisterNameSpace(session, object_creation[i].cf,
|
IInternetSession_RegisterNameSpace(session, object_creation[i].cf,
|
||||||
object_creation[i].clsid, object_creation[i].protocol, 0, NULL, 0);
|
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
|
else
|
||||||
|
{
|
||||||
|
/* make sure that the Release on the class factory doesn't unload us */
|
||||||
|
URLMON_LockModule();
|
||||||
IInternetSession_UnregisterNameSpace(session, object_creation[i].cf,
|
IInternetSession_UnregisterNameSpace(session, object_creation[i].cf,
|
||||||
object_creation[i].protocol);
|
object_creation[i].protocol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
IInternetSession_Release(session);
|
IInternetSession_Release(session);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue