Bug 918479 - Remove listeners from a message manager if the child side dies, r=fabrice

--HG--
extra : rebase_source : 1e3b0fb36c5e489225bca8ea42b5bf21eb7d7755
This commit is contained in:
Olli Pettay 2013-10-16 00:15:30 +03:00
parent 3ed9c2e5d6
commit 9bef96b103

View File

@ -294,7 +294,9 @@ TabParent::ActorDestroy(ActorDestroyReason why)
}
nsRefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
nsCOMPtr<nsIObserverService> os = services::GetObserverService();
nsRefPtr<nsFrameMessageManager> fmm;
if (frameLoader) {
fmm = frameLoader->GetFrameMessageManager();
nsCOMPtr<Element> frameElement(mFrameElement);
ReceiveMessage(CHILD_PROCESS_SHUTDOWN_MESSAGE, false, nullptr, nullptr);
frameLoader->DestroyChild();
@ -311,6 +313,9 @@ TabParent::ActorDestroy(ActorDestroyReason why)
if (os) {
os->NotifyObservers(NS_ISUPPORTS_CAST(nsITabParent*, this), "ipc:browser-destroyed", nullptr);
}
if (fmm) {
fmm->Disconnect();
}
}
bool