Bug 951491 - Ensure ResumeTimeouts() after FreeInnerObjects() does nothing. r=bz

This commit is contained in:
Andrew McCreight 2014-02-19 13:27:15 -08:00
parent 6b6b4bece1
commit ac2549bd60
2 changed files with 8 additions and 1 deletions

View File

@ -1083,6 +1083,7 @@ nsGlobalWindow::nsGlobalWindow(nsGlobalWindow *aOuterWindow)
#endif
mShowFocusRingForContent(false),
mFocusByKeyOccurred(false),
mInnerObjectsFreed(false),
mHasGamepad(false),
#ifdef MOZ_GAMEPAD
mHasSeenGamepadInput(false),
@ -1520,6 +1521,8 @@ nsGlobalWindow::FreeInnerObjects()
// re-create.
NotifyDOMWindowDestroyed(this);
mInnerObjectsFreed = true;
// Kill all of the workers for this window.
mozilla::dom::workers::CancelWorkersForWindow(this);
@ -12561,7 +12564,7 @@ nsGlobalWindow::ResumeTimeouts(bool aThawChildren)
NS_ASSERTION(mTimeoutsSuspendDepth, "Mismatched calls to ResumeTimeouts!");
--mTimeoutsSuspendDepth;
bool shouldResume = (mTimeoutsSuspendDepth == 0);
bool shouldResume = (mTimeoutsSuspendDepth == 0) && !mInnerObjectsFreed;
nsresult rv;
if (shouldResume) {

View File

@ -1407,6 +1407,10 @@ protected:
// should be displayed.
bool mFocusByKeyOccurred : 1;
// Ensure that a call to ResumeTimeouts() after FreeInnerObjects() does nothing.
// This member is only used by inner windows.
bool mInnerObjectsFreed : 1;
// Indicates whether this window wants gamepad input events
bool mHasGamepad : 1;
#ifdef MOZ_GAMEPAD