nsTraceRefcnt::ResetStatistics();
nsresult NS_COM NS_ShutdownXPCOM(nsIServiceManager* servMgr){    nsrefcnt cnt;    // Release our own singletons...    XPTI_FreeInterfaceInfoManager();    // We may have AddRef'd for the caller of NS_InitXPCOM, so release it    // here again:                                                                 NS_IF_RELEASE(servMgr);    NS_RELEASE2(nsServiceManager::mGlobalServiceManager, cnt);    NS_ASSERTION(cnt == 0, "Service Manager being held past XPCOM shutdown.");    // Finally, release the component manager last because it unloads the    // libraries:    NS_RELEASE2(nsComponentManagerImpl::gComponentManager, cnt);    NS_ASSERTION(cnt == 0, "Component Manager being held past XPCOM shutdown.");#ifdef DEBUG    extern void _FreeAutoLockStatics();    _FreeAutoLockStatics();#endif    NS_PurgeAtomTable();#ifdef BLOATY    NS_DumpBloatStatistics();#endif#if defined(DEBUG) && (defined(_WIN32) || defined(XP_UNIX))    if (getenv("MOZ_DUMP_LEAKS")) {        nsTraceRefcnt::DumpLeaks(stderr);        nsTraceRefcnt::FlushCtorRegistry();    }#endif#ifdef GC_LEAK_DETECTOR	// Shutdown the GC.	NSShutdownGarbageCollector();#endif    return NS_OK;}