Bug 1191112 part 2 - Set the destroyed flag on nsCocoaWindow when destroyed. r=smichaud
authorXidorn Quan <quanxunzhen@gmail.com>
Thu, 06 Aug 2015 15:37:48 +1000
changeset 288143 988184cd378ec56523dbcdfcffefe93d27ea08bf
parent 288142 1f5f32b97e0ddd31c267a491f4c36bc8ddbe29d2
child 288144 d5813935e9a33c27be2391a1cd8617b1e8a9e6f4
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)
reviewerssmichaud
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 2 - Set the destroyed flag on nsCocoaWindow when destroyed. r=smichaud
widget/cocoa/nsCocoaWindow.mm
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -495,16 +495,20 @@ NS_IMETHODIMP nsCocoaWindow::CreatePopup
 
   return NS_OK;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT;
 }
 
 NS_IMETHODIMP nsCocoaWindow::Destroy()
 {
+  if (mOnDestroyCalled)
+    return NS_OK;
+  mOnDestroyCalled = true;
+
   // If we don't hide here we run into problems with panels, this is not ideal.
   // (Bug 891424)
   Show(false);
 
   if (mPopupContentView)
     mPopupContentView->Destroy();
 
   nsBaseWidget::Destroy();