mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-15 03:00:30 +00:00
bug 1329814 - fix race condition when shutting down a tab r=smaug
When TabChild recieves the Destroy message from its parent the doc accessibles for that tab are shut down. However if the Shutdown message sent by DocAccessible::Shutdown() isn't recieved before the child process handles the runnable that sends __delete__ to the tab parent actor the parent can send a message to the already shut down doc accessible child actor.
This commit is contained in:
parent
054061a872
commit
235c3677ff
@ -416,9 +416,14 @@ DocAccessibleParent::RecvShutdown()
|
||||
void
|
||||
DocAccessibleParent::Destroy()
|
||||
{
|
||||
// If we are already shutdown that is because our containing tab parent is
|
||||
// shutting down in which case we don't need to do anything.
|
||||
if (mShutdown) {
|
||||
return;
|
||||
}
|
||||
|
||||
NS_ASSERTION(mChildDocs.IsEmpty(),
|
||||
"why weren't the child docs destroyed already?");
|
||||
MOZ_ASSERT(!mShutdown);
|
||||
mShutdown = true;
|
||||
|
||||
uint32_t childDocCount = mChildDocs.Length();
|
||||
|
@ -359,6 +359,10 @@ TabParent::DestroyInternal()
|
||||
|
||||
RemoveWindowListeners();
|
||||
|
||||
if (a11y::DocAccessibleParent* tabDoc = GetTopLevelDocAccessible()) {
|
||||
tabDoc->Destroy();
|
||||
}
|
||||
|
||||
// If this fails, it's most likely due to a content-process crash,
|
||||
// and auto-cleanup will kick in. Otherwise, the child side will
|
||||
// destroy itself and send back __delete__().
|
||||
|
Loading…
Reference in New Issue
Block a user