Fixed another potential timer leak when closing a viewer

If the viewer was closed in response to an event raised during the
update function, the timer would have continued running.
This commit is contained in:
Ian Gilman 2013-06-17 11:30:31 -07:00
parent 0112f6a4ea
commit 4224960252

View File

@ -1468,8 +1468,11 @@ function updateMulti( viewer ) {
beginTime = +new Date(); beginTime = +new Date();
updateOnce( viewer ); updateOnce( viewer );
THIS[ viewer.hash ].updateRequestId = scheduleUpdate( viewer, // Request the next frame, unless we've been closed during the updateOnce()
arguments.callee, beginTime ); if ( viewer.source ) {
THIS[ viewer.hash ].updateRequestId = scheduleUpdate( viewer,
arguments.callee, beginTime );
}
} }
function updateOnce( viewer ) { function updateOnce( viewer ) {