Bug 1191112 part 3 - Don't touch the widget anymore if it has been destroyed during the fullscreen transition. r=smaug
authorXidorn Quan <quanxunzhen@gmail.com>
Thu, 06 Aug 2015 15:37:48 +1000
changeset 288144 d5813935e9a33c27be2391a1cd8617b1e8a9e6f4
parent 288143 988184cd378ec56523dbcdfcffefe93d27ea08bf
child 288145 2d09363a1516e74bcab7514643f8b5c77b91e65a
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1191112
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1191112 part 3 - Don't touch the widget anymore if it has been destroyed during the fullscreen transition. r=smaug
dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -6353,16 +6353,22 @@ private:
 const char* const
 FullscreenTransitionTask::kPaintedTopic = "fullscreen-painted";
 
 NS_IMETHODIMP
 FullscreenTransitionTask::Run()
 {
   Stage stage = mStage;
   mStage = Stage(mStage + 1);
+  if (MOZ_UNLIKELY(mWidget->Destroyed())) {
+    // If the widget has been destroyed before we get here, don't try to
+    // do anything more. Just let it go and release ourselves.
+    NS_WARNING("The widget to fullscreen has been destroyed");
+    return NS_OK;
+  }
   if (stage == eBeforeToggle) {
     mWidget->PerformFullscreenTransition(nsIWidget::eBeforeFullscreenToggle,
                                          mDuration.mFadeIn, mTransitionData,
                                          this);
   } else if (stage == eToggleFullscreen) {
     if (MOZ_UNLIKELY(mWindow->mFullScreen != mFullscreen)) {
       // This could happen in theory if several fullscreen requests in
       // different direction happen continuously in a short time. We