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:
Bobby Holley 2013-05-17 10:43:18 -07:00
Родитель 05aeb68295
Коммит 327fe31318
1 изменённых файлов: 10 добавлений и 3 удалений

Просмотреть файл

@ -1232,9 +1232,16 @@ nsGlobalWindow::~nsGlobalWindow()
mDoc = nullptr;
NS_ASSERTION(!mArguments, "mArguments wasn't cleaned up properly!");
// 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)