Bug 708136 - Don't teardown GL objects if teardown's makecurrent fails - r=bjacob
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 30 Apr 2012 19:05:59 -0700
changeset 92786 2ddc5dea534b3c71a5b39c6932c3294ae93b51ef
parent 92785 f031b89c104ef17a9c9fd35925b8c70e48829743
child 92787 568f9b7df8621af730e8279e1846f2eeb005f4b1
push id8872
push userjgilbert@mozilla.com
push dateTue, 01 May 2012 02:06:18 +0000
treeherdermozilla-inbound@2ddc5dea534b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjacob
bugs708136
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 708136 - Don't teardown GL objects if teardown's makecurrent fails - r=bjacob
gfx/gl/GLContext.cpp
--- a/gfx/gl/GLContext.cpp
+++ b/gfx/gl/GLContext.cpp
@@ -1743,23 +1743,26 @@ GLContext::UpdateActualFormat()
 }
 
 void
 GLContext::MarkDestroyed()
 {
     if (IsDestroyed())
         return;
 
-    MakeCurrent();
-    DeleteOffscreenFBOs();
-
-    fDeleteProgram(mBlitProgram);
-    mBlitProgram = 0;
-    fDeleteFramebuffers(1, &mBlitFramebuffer);
-    mBlitFramebuffer = 0;
+    if (MakeCurrent()) {
+        DeleteOffscreenFBOs();
+
+        fDeleteProgram(mBlitProgram);
+        mBlitProgram = 0;
+        fDeleteFramebuffers(1, &mBlitFramebuffer);
+        mBlitFramebuffer = 0;
+    } else {
+        NS_WARNING("MakeCurrent() failed during MarkDestroyed! Skipping GL object teardown.");
+    }
 
     mSymbols.Zero();
 }
 
 static void SwapRAndBComponents(gfxImageSurface* aSurf)
 {
   gfxIntSize size = aSurf->GetSize();
   for (int j = 0; j < size.height; ++j) {