Bug 736481 - 6/7 - WebGL lost context handling: check if we still have a canvas - r=jgilbert, a=blocking-fennec

This commit is contained in:
Benoit Jacob 2012-04-21 16:48:22 -04:00
Родитель eb6d8f0226
Коммит 41be85bf4f
1 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -1055,6 +1055,13 @@ NS_IMETHODIMP
WebGLContext::Notify(nsITimer* timer)
{
TerminateContextLossTimer();
if (!HTMLCanvasElement()) {
// the canvas is gone. That happens when the page was closed before we got
// this timer event. In this case, there's nothing to do here, just don't crash.
return NS_OK;
}
// If the context has been lost and we're waiting for it to be restored, do
// that now.
if (mContextStatus == ContextLostAwaitingEvent) {