зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
05aeb68295
Коммит
327fe31318
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче