Bug 547247 - '[OOPP] Crash [@ RtlEnterCriticalSection ] when ending mozilla-runtime on a page that does not contain a plugin'. Bustage fix

This commit is contained in:
Ben Turner 2010-02-19 12:45:47 -08:00
parent ed20dab3cd
commit 9511d287cb
2 changed files with 19 additions and 15 deletions

View File

@ -616,16 +616,18 @@ RPCChannel::OnChannelError()
{
AssertIOThread();
MutexAutoLock lock(mMutex);
{
MutexAutoLock lock(mMutex);
// NB: this can race with the `Goodbye' event being processed by
// the worker thread
if (ChannelClosing != mChannelState)
mChannelState = ChannelError;
// NB: this can race with the `Goodbye' event being processed by
// the worker thread
if (ChannelClosing != mChannelState)
mChannelState = ChannelError;
// skip SyncChannel::OnError(); we subsume its duties
if (AwaitingSyncReply() || 0 < StackDepth())
NotifyWorkerThread();
// skip SyncChannel::OnError(); we subsume its duties
if (AwaitingSyncReply() || 0 < StackDepth())
NotifyWorkerThread();
}
AsyncChannel::OnChannelError();
}

View File

@ -210,15 +210,17 @@ SyncChannel::OnChannelError()
{
AssertIOThread();
MutexAutoLock lock(mMutex);
{
MutexAutoLock lock(mMutex);
// NB: this can race with the `Goodbye' event being processed by
// the worker thread
if (ChannelClosing != mChannelState)
mChannelState = ChannelError;
// NB: this can race with the `Goodbye' event being processed by
// the worker thread
if (ChannelClosing != mChannelState)
mChannelState = ChannelError;
if (AwaitingSyncReply())
NotifyWorkerThread();
if (AwaitingSyncReply())
NotifyWorkerThread();
}
AsyncChannel::OnChannelError();
}