summaryrefslogtreecommitdiffstats
path: root/xpfe/appshell
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-05-06 11:15:48 +0000
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-05-06 19:16:51 +0200
commit883fa80f7d3288d3ffbefd7b32cb579cbfacbbe8 (patch)
tree03216362599e1c19d610809c93a18132516a4b2c /xpfe/appshell
parent82b6d2cf9d50a0eaf15697501f62848cf6316c07 (diff)
downloadUXP-883fa80f7d3288d3ffbefd7b32cb579cbfacbbe8.tar
UXP-883fa80f7d3288d3ffbefd7b32cb579cbfacbbe8.tar.gz
UXP-883fa80f7d3288d3ffbefd7b32cb579cbfacbbe8.tar.lz
UXP-883fa80f7d3288d3ffbefd7b32cb579cbfacbbe8.tar.xz
UXP-883fa80f7d3288d3ffbefd7b32cb579cbfacbbe8.zip
[XPFE] Properly anchor XUL windows when tearing down
Diffstat (limited to 'xpfe/appshell')
-rw-r--r--xpfe/appshell/nsXULWindow.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/xpfe/appshell/nsXULWindow.cpp b/xpfe/appshell/nsXULWindow.cpp
index 8f2d9fde5..585085065 100644
--- a/xpfe/appshell/nsXULWindow.cpp
+++ b/xpfe/appshell/nsXULWindow.cpp
@@ -455,6 +455,8 @@ NS_IMETHODIMP nsXULWindow::Destroy()
if (mDestroying)
return NS_OK;
+ nsCOMPtr<nsIXULWindow> kungFuDeathGrip(this);
+
mozilla::AutoRestore<bool> guard(mDestroying);
mDestroying = true;
@@ -467,16 +469,6 @@ NS_IMETHODIMP nsXULWindow::Destroy()
if (parentWindow)
parentWindow->RemoveChildWindow(this);
- // let's make sure the window doesn't get deleted out from under us
- // while we are trying to close....this can happen if the docshell
- // we close ends up being the last owning reference to this xulwindow
-
- // XXXTAB This shouldn't be an issue anymore because the ownership model
- // only goes in one direction. When webshell container is fully removed
- // try removing this...
-
- nsCOMPtr<nsIXULWindow> placeHolder = this;
-
// Remove modality (if any) and hide while destroying. More than
// a convenience, the hide prevents user interaction with the partially
// destroyed window. This is especially necessary when the eldest window