Bug 1313585 - Part 1: Removing gamepads while nsGlobalWindow is removed in GamepadManager; r=lenzak800,qdot

MozReview-Commit-ID: 8kh0hyqzOyW

--HG--
extra : rebase_source : 51f3bbf930f5d8eb5a53b83ca47600d26346599c
This commit is contained in:
Daosheng Mu 2016-10-28 15:58:22 +08:00
parent 39c2a3224e
commit 7331dee69c

View File

@ -177,6 +177,10 @@ GamepadManager::RemoveListener(nsGlobalWindow* aWindow)
return; // doesn't exist
}
for (auto iter = mGamepads.Iter(); !iter.Done(); iter.Next()) {
aWindow->RemoveGamepad(iter.Key());
}
mListeners.RemoveElement(aWindow);
if (mListeners.IsEmpty()) {