Bug 814549 - Fix OOP app segfault when exiting the app. r=cjones

This commit is contained in:
Dave Hylands 2012-11-27 19:07:19 -08:00
parent aa99449330
commit 40d037c83d

View File

@ -592,14 +592,18 @@ nsAppShell::nsAppShell()
nsAppShell::~nsAppShell()
{
// We separate requestExit() and join() here so we can wake the EventHub's
// input loop, and stop it from polling for input events
mReaderThread->requestExit();
mEventHub->wake();
// mReaderThread and mEventHub will both be null if InitInputDevices
// is not called.
if (mReaderThread.get()) {
// We separate requestExit() and join() here so we can wake the EventHub's
// input loop, and stop it from polling for input events
mReaderThread->requestExit();
mEventHub->wake();
status_t result = mReaderThread->requestExitAndWait();
if (result)
LOG("Could not stop reader thread - %d", result);
status_t result = mReaderThread->requestExitAndWait();
if (result)
LOG("Could not stop reader thread - %d", result);
}
gAppShell = NULL;
}