Fixing leak regression from bug 200632 landing (the latest cookie rewrite).

This changes the nsCookieService singleton fu to AddRef only once, rather than twice (and removes the corresponding Release in the module dtor). The double-addref was making the cookie module stick around until XPCOM starts shutting down modules, which is too late to release things we own (observer service, prefbranch, etc). So we were violating XPCOM shutdown rules without knowing it.

So, the tracemalloc leak stats on Brad should halve. :)

b=209571, r=alecf, sr=darin.


git-svn-id: svn://10.0.0.236/trunk@144084 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dwitte%stanford.edu
2003-06-24 05:00:22 +00:00
parent 600f1dae13
commit 1868bf16e5
3 changed files with 35 additions and 56 deletions

View File

@@ -139,11 +139,4 @@ static const nsModuleComponentInfo components[] = {
},
};
PR_STATIC_CALLBACK(void)
cookieModuleDtor(nsIModule *aSelf)
{
// Release our singletons
nsCookieService::FreeSingleton();
}
NS_IMPL_NSGETMODULE_WITH_DTOR(nsCookieModule, components, cookieModuleDtor)
NS_IMPL_NSGETMODULE(nsCookieModule, components)