Bug 1156472 - Part 14 - Null check the window, because it can be different during the window's shutdown. r=baku

In which case everything is cleaned up properly by the HTMLMediaElement themselves.
This commit is contained in:
Paul Adenot 2015-07-24 14:28:17 +02:00
parent a057ca77e0
commit 1bbf6e6702

View File

@ -562,6 +562,15 @@ AudioChannelService::RefreshAgentsCapture(nsPIDOMWindow* aWindow,
AudioChannelWindow* winData = GetWindowData(pTopWindow->WindowID());
// This can happen, but only during shutdown, because the the outer window
// changes ScriptableTop, so that its ID is different.
// In this case either we are capturing, and it's too late because the window
// has been closed anyways, or we are un-capturing, and everything has already
// been cleaned up by the HTMLMediaElements or the AudioContexts.
if (!winData) {
return;
}
nsTObserverArray<AudioChannelAgent*>::ForwardIterator
iter(winData->mAgents);
while (iter.HasMore()) {