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

This commit is contained in:
Joe Drew 2011-08-03 16:39:53 -04:00
parent f8bddd9a2f
commit 3c75d08723

View File

@ -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())