Calling "top.window.close()" from within a timeout crashes (in M7)

VERIFIED FIXED

Status

()

P3
major
VERIFIED FIXED
20 years ago
20 years ago

People

(Reporter: tonyr, Assigned: vidur)

Tracking

Trunk
x86
Windows 98
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

20 years ago
(I had no idea which component to assign this to but since the code is in the DOM
directory...)

The following JavaScript attached to any window opened using
window.openDialog(...) causes a crash in nsGlobalWindow.cpp at line #1560, seems
like this would occur on all platforms but I don't currently have any way to
verify that.

--------------------------------------------
var intervalState = null;
var intervalCount = 0;
function OnLoadWindow()
{
	intervalState = setInterval( "OnInterval()", 100);
}

function OnInterval()
{
	// do something a few times
	intervalCount = intervalCount + 1;
	if (intervalCount > 10) {
		clearInterval( intervalState);
		top.window.close();
	}
}

-----------------------------------------

In GlobalWindowImpl::RunTimeout(...) after the timeout script is evaluated, it
calls "mContext->ScriptEvaluated()".  Apparently, the top.window.close()
JavaScript call causes mContext to become null which crashes.
(Assignee)

Updated

20 years ago
Status: NEW → RESOLVED
Last Resolved: 20 years ago
Resolution: --- → FIXED
(Assignee)

Comment 1

20 years ago
Oops! Forgot to close this and say that a fix was checked in on 7/8/1999.

Updated

20 years ago
Status: RESOLVED → VERIFIED

Comment 2

20 years ago
Verified. Marking verified.
You need to log in before you can comment on or make changes to this bug.