Skip to content

Commit bbb532e

Browse files
committed
[WebGL] avoid 'forceContextLost' notifications during destruction
GraphicsContextGLANGLE::reshape(0, 0) may trigger `forceContextLost` if it fails to reshape FBOs. If it happens during HTMLCanvasElement destruction it will capture areference to an HTMLCanvasElement that is being destroyed, and lead to a double destruction of HTMLCanvasElement and random crashes.
1 parent 4336cfc commit bbb532e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,9 +700,9 @@ void WebGLRenderingContextBase::destroyGraphicsContextGL()
700700
removeActivityStateChangeObserver();
701701

702702
if (m_context) {
703-
// first release the big textures allocated for the FBOs
704-
m_context->reshape(0,0);
705703
m_context->setClient(nullptr);
704+
// release the big textures allocated for the FBOs
705+
m_context->reshape(0,0);
706706
m_context = nullptr;
707707
removeActiveContext(*this);
708708
}

0 commit comments

Comments
 (0)