mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 860941 - Clarify shutdown invariants in ~nsGlobalWindow. r=jst
While the mArguments invariant should hold for _outers_, it doesn't necessarily hold for inners, so this assertion fires reliably in automation. If mCleanedUp is true then mArguments is definitely null, so let's disentangle this from mArguments and be clearer about the invariants we expect.
This commit is contained in:
parent
0d5c9c4ac9
commit
1423107658
@ -1232,9 +1232,16 @@ nsGlobalWindow::~nsGlobalWindow()
|
||||
|
||||
mDoc = nullptr;
|
||||
|
||||
NS_ASSERTION(!mArguments, "mArguments wasn't cleaned up properly!");
|
||||
|
||||
CleanUp(true);
|
||||
// Outer windows are always supposed to call CleanUp before letting themselves
|
||||
// be destroyed. And while CleanUp generally seems to be intended to clean up
|
||||
// outers, we've historically called it for both. Changing this would probably
|
||||
// involve auditing all of the references that inners and outers can have, and
|
||||
// separating the handling into CleanUp() and FreeInnerObjects.
|
||||
if (IsInnerWindow()) {
|
||||
CleanUp(true);
|
||||
} else {
|
||||
MOZ_ASSERT(mCleanedUp);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDeviceSensors> ac = do_GetService(NS_DEVICE_SENSORS_CONTRACTID);
|
||||
if (ac)
|
||||
|
Loading…
Reference in New Issue
Block a user