зеркало из https://github.com/mozilla/gecko-dev.git
Bug 621056 - Prevent the timer to be eaten alive by the GC. r=bz a=tests
This commit is contained in:
Родитель
bb984d1400
Коммит
1e706f35e0
|
@ -1,3 +1,6 @@
|
|||
// timer has to be alive so it can't be eaten by the GC.
|
||||
var timer;
|
||||
|
||||
function handleRequest(request, response)
|
||||
{
|
||||
response.setHeader("Cache-Control", "no-cache", false);
|
||||
|
@ -5,7 +8,7 @@ function handleRequest(request, response)
|
|||
// The "stray" open comment at the end of the write is important!
|
||||
response.write("document.write(\"<script charset='utf-8' src='script-2_bug597345.js'></script><!--\")");
|
||||
response.processAsync();
|
||||
var timer = Components.classes["@mozilla.org/timer;1"]
|
||||
timer = Components.classes["@mozilla.org/timer;1"]
|
||||
.createInstance(Components.interfaces.nsITimer);
|
||||
timer.initWithCallback(function() {
|
||||
response.finish();
|
||||
|
|
Загрузка…
Ссылка в новой задаче