From 3c75d0872399fa497e3f6b36c7607d0a665c5605 Mon Sep 17 00:00:00 2001 From: Joe Drew Date: Wed, 3 Aug 2011 16:39:53 -0400 Subject: [PATCH] Bug 627015 - Hold on to a reference to the timer, so it doesn't get collected from under us. over-the-shoulder-r=jrmuizel,jdm --- modules/libpr0n/test/crashtests/delayedframe.sjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/libpr0n/test/crashtests/delayedframe.sjs b/modules/libpr0n/test/crashtests/delayedframe.sjs index b9e87adf776..31eb1eff8e4 100644 --- a/modules/libpr0n/test/crashtests/delayedframe.sjs +++ b/modules/libpr0n/test/crashtests/delayedframe.sjs @@ -16,6 +16,8 @@ function getFileStream(filename) return fileStream; } +var gTimer; + function handleRequest(request, response) { response.processAsync(); @@ -26,8 +28,8 @@ function handleRequest(request, response) response.bodyOutputStream.writeFrom(firststream, firststream.available()) firststream.close(); - var timer = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer); - timer.initWithCallback(function() + gTimer = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer); + gTimer.initWithCallback(function() { var secondstream = getFileStream("threeframes-end.gif"); response.bodyOutputStream.writeFrom(secondstream, secondstream.available())