mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 717498 - Clear nsThread::mEventObservers at thread shutdown. r=bsmedberg
This commit is contained in:
parent
b4cfcc0491
commit
3695ee3b7a
@ -506,6 +506,11 @@ nsThread::Shutdown()
|
||||
PR_JoinThread(mThread);
|
||||
mThread = nsnull;
|
||||
|
||||
// We hold strong references to our event observers, and once the thread is
|
||||
// shut down the observers can't easily unregister themselves. Do it here
|
||||
// to avoid leaking.
|
||||
ClearObservers();
|
||||
|
||||
#ifdef DEBUG
|
||||
{
|
||||
MutexAutoLock lock(mLock);
|
||||
|
@ -77,6 +77,9 @@ public:
|
||||
// nsIThreadManager::NewThread.
|
||||
bool ShutdownRequired() { return mShutdownRequired; }
|
||||
|
||||
// Clear the observer list.
|
||||
void ClearObservers() { mEventObservers.Clear(); }
|
||||
|
||||
// The global thread observer
|
||||
static nsIThreadObserver* sGlobalObserver;
|
||||
|
||||
|
@ -176,6 +176,7 @@ nsThreadManager::Shutdown()
|
||||
// main thread is special we do it manually here after we're sure all events
|
||||
// have been processed.
|
||||
mMainThread->SetObserver(nsnull);
|
||||
mMainThread->ClearObservers();
|
||||
|
||||
// Release main thread object.
|
||||
mMainThread = nsnull;
|
||||
|
Loading…
Reference in New Issue
Block a user