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

This commit is contained in:
Andrew McCreight 2014-02-20 12:55:40 -08:00
Родитель f8982091af
Коммит 8404f86555
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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