mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 09:57:32 +09:00
No Issue - Make nsCocoaWindow hold a death grip on its native window until its destructor. https://bugzilla.mozilla.org/show_bug.cgi?id=1880582
This commit is contained in:
parent
e825209039
commit
1554c778f4
2 changed files with 15 additions and 1 deletions
|
|
@ -110,6 +110,7 @@ nsCocoaWindow::nsCocoaWindow()
|
|||
: mParent(nullptr)
|
||||
, mAncestorLink(nullptr)
|
||||
, mWindow(nil)
|
||||
, mClosedRetainedWindow(nil)
|
||||
, mDelegate(nil)
|
||||
, mSheetWindowParent(nil)
|
||||
, mPopupContentView(nil)
|
||||
|
|
@ -148,6 +149,12 @@ void nsCocoaWindow::DestroyNativeWindow()
|
|||
// We want to unhook the delegate here because we don't want events
|
||||
// sent to it after this object has been destroyed.
|
||||
[mWindow setDelegate:nil];
|
||||
// Closing the window will also release it. Our second reference will
|
||||
// keep it alive through our destructor. Release any reference we might
|
||||
// have from an earlier call to DestroyNativeWindow, then create a new
|
||||
// one.
|
||||
[mClosedRetainedWindow autorelease];
|
||||
mClosedRetainedWindow = [mWindow retain];
|
||||
[mWindow close];
|
||||
mWindow = nil;
|
||||
[mDelegate autorelease];
|
||||
|
|
@ -182,6 +189,8 @@ nsCocoaWindow::~nsCocoaWindow()
|
|||
DestroyNativeWindow();
|
||||
}
|
||||
|
||||
[mClosedRetainedWindow release];
|
||||
|
||||
NS_IF_RELEASE(mPopupContentView);
|
||||
|
||||
// Deal with the possiblity that we're being destroyed while running modal.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue