gecko-dev/dom/tests/browser/geo_leak_test.html
Andrew McCreight 9f632b6e53 Bug 1238427 - Avoid a strong reference from the timeout timer to nsGeolocationRequest. r=jdm
The timeout timer of a geolocation request holds a strong reference to
the request. This can cause the window to leak if the request is not
completed before the tab containing the window is closed.

To fix this, I made the timer instead hold a strong reference to a
wrapper class that has only a weak reference to the request. The
request destructor must now cancel the timeout timer.

I also outlined a call to StopTimeoutTimer() in
nsGeolocationRequest::Shutdown().
2016-01-21 09:57:30 -08:00

18 lines
393 B
HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>Geolocation incomplete position leak test</title>
<script type="text/javascript">
function successCallback(position) {}
function errorCallback() {}
function init() {
navigator.geolocation.getCurrentPosition(successCallback, errorCallback);
}
</script>
</head>
<body onload="init()">
</body>
</html>