Bug 539451: Clean up OOP crashreporter stuff in UnsetExceptionhandler(). r=luser

This commit is contained in:
Chris Jones 2010-01-20 20:17:40 -06:00
Родитель 4726d6df15
Коммит a6714b12d5
1 изменённых файлов: 29 добавлений и 1 удалений

Просмотреть файл

@ -734,6 +734,8 @@ nsresult SetupExtraData(nsILocalFile* aAppDataDirectory,
return NS_OK;
}
static void OOPDeinit();
nsresult UnsetExceptionHandler()
{
delete gExceptionHandler;
@ -765,6 +767,10 @@ nsresult UnsetExceptionHandler()
gExceptionHandler = nsnull;
#ifdef MOZ_IPC
OOPDeinit();
#endif
return NS_OK;
}
@ -1102,7 +1108,6 @@ OOPInit()
"attempt to initialize OOP crash reporter before in-process crashreporter!");
#if defined(XP_WIN)
// This is intentionally leaked, bug 539451
childCrashNotifyPipe =
PR_smprintf("\\\\.\\pipe\\gecko-crash-server-pipe.%i",
static_cast<int>(::GetCurrentProcessId()));
@ -1140,6 +1145,29 @@ OOPInit()
dumpMapLock = new Mutex("CrashReporter::dumpMapLock");
}
static void
OOPDeinit()
{
if (!OOPInitialized()) {
NS_WARNING("OOPDeinit() without successful OOPInit()");
return;
}
delete crashServer;
crashServer = NULL;
delete dumpMapLock;
dumpMapLock = NULL;
delete pidToMinidump;
pidToMinidump = NULL;
#if defined(XP_WIN)
PR_Free(childCrashNotifyPipe);
childCrashNotifyPipe = NULL;
#endif
}
#if defined(XP_WIN)
// Parent-side API for children
const char*