mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 12:15:33 +00:00
9f632b6e53
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().
18 lines
393 B
HTML
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>
|