diff --git a/gfx/gl/GLContext.cpp b/gfx/gl/GLContext.cpp index 79b6d756964..a39b5ccd53a 100644 --- a/gfx/gl/GLContext.cpp +++ b/gfx/gl/GLContext.cpp @@ -1748,13 +1748,16 @@ GLContext::MarkDestroyed() if (IsDestroyed()) return; - MakeCurrent(); - DeleteOffscreenFBOs(); + if (MakeCurrent()) { + DeleteOffscreenFBOs(); - fDeleteProgram(mBlitProgram); - mBlitProgram = 0; - fDeleteFramebuffers(1, &mBlitFramebuffer); - mBlitFramebuffer = 0; + fDeleteProgram(mBlitProgram); + mBlitProgram = 0; + fDeleteFramebuffers(1, &mBlitFramebuffer); + mBlitFramebuffer = 0; + } else { + NS_WARNING("MakeCurrent() failed during MarkDestroyed! Skipping GL object teardown."); + } mSymbols.Zero(); }