Issue #2452 - Bail out from PresShell::Initialize if the pres shell is being destroyed in XBLConstructorRunner

https://bugzilla.mozilla.org/show_bug.cgi?id=1428694
This commit is contained in:
Martok 2024-01-14 21:55:06 +01:00 committed by roytam1
commit a9d7255ba1

View file

@ -1771,6 +1771,9 @@ PresShell::Initialize(nscoord aWidth, nscoord aHeight)
// (Do this in a script runner, since our caller might have a script
// blocker on the stack.)
nsContentUtils::AddScriptRunner(new XBLConstructorRunner(mDocument));
// XBLConstructorRunner might destroy us.
NS_ENSURE_STATE(!mHaveShutDown);
}
NS_ASSERTION(rootFrame, "How did that happen?");