Bug 842476: Work around leak resulting from exception that happens during unload by propagating only the prompts we expect and not the later ones. r=jlebar

Make this test less sensitive to the timing of its own unloading by
passing on only the expected messages and not any messages that occur
during unloading.  Such messages might cause exceptions (e.g.,
"'TypeError: can't access dead object' when calling method:
[nsIPrompt::alert]"), and those exceptions might in turn trigger leaks
in nsXPConnect that last until shutdown because we store the most recent
exception from a call to an XPCWrappedJS on the XPCJSRuntime through
shutdown (rather than reporting it, as we probably should, and then
freeing it), leaking the window.
This commit is contained in:
L. David Baron 2013-02-24 23:42:38 -08:00
parent ebe9a6d53b
commit ca1bc93d5f

View File

@ -21,7 +21,7 @@ function handlePrompt(e) {
alert('parent:ready');
}
else if (numPrompts > 3) {
else if (numPrompts == 4 || numPrompts == 5) {
alert(e.detail.message);
}
}