mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
initialization/shutdown code for GC leak detector. conditionalized on GC_LEAK_DETECTOR. r=sfraser
This commit is contained in:
parent
ed5ef54678
commit
f6b231af47
@ -148,11 +148,21 @@ nsIServiceManager* nsServiceManager::mGlobalServiceManager = NULL;
|
||||
nsComponentManagerImpl* nsComponentManagerImpl::gComponentManager = NULL;
|
||||
static nsFileSpec registryDirName;
|
||||
|
||||
#ifdef GC_LEAK_DETECTOR
|
||||
extern "C" void NSInitGarbageCollector(void);
|
||||
extern "C" void NSShutdownGarbageCollector(void);
|
||||
#endif
|
||||
|
||||
nsresult NS_COM NS_InitXPCOM(nsIServiceManager* *result,
|
||||
nsFileSpec *registryFile, nsFileSpec *componentDir)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
#ifdef GC_LEAK_DETECTOR
|
||||
// 0. Initialize the GC.
|
||||
NSInitGarbageCollector();
|
||||
#endif
|
||||
|
||||
// 1. Create the Global Service Manager
|
||||
nsIServiceManager* servMgr = NULL;
|
||||
if (nsServiceManager::mGlobalServiceManager == NULL)
|
||||
@ -457,6 +467,12 @@ nsresult NS_COM NS_ShutdownXPCOM(nsIServiceManager* servMgr)
|
||||
extern void _FreeAutoLockStatics();
|
||||
_FreeAutoLockStatics();
|
||||
#endif
|
||||
|
||||
#ifdef GC_LEAK_DETECTOR
|
||||
// Shutdown the GC.
|
||||
NSShutdownGarbageCollector();
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user