diff mbox

[Branch,~glmark2-dev/glmark2/trunk] Rev 131: Only delete textures/framebuffers if they were gen'd in the first place. Mesa

Message ID 20110913163313.22571.15902.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Jesse Barker Sept. 13, 2011, 4:33 p.m. UTC
------------------------------------------------------------
revno: 131
committer: Jesse Barker <jesse.barker@linaro.org>
branch nick: trunk
timestamp: Tue 2011-09-13 09:31:11 -0700
message:
  Only delete textures/framebuffers if they were gen'd in the first place.  Mesa
  GLESv2 implementation was segfaulting based upon this.
modified:
  src/scene-desktop.cpp


--
lp:glmark2
https://code.launchpad.net/~glmark2-dev/glmark2/trunk

You are subscribed to branch lp:glmark2.
To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'src/scene-desktop.cpp'
--- src/scene-desktop.cpp	2011-09-13 09:36:32 +0000
+++ src/scene-desktop.cpp	2011-09-13 16:31:11 +0000
@@ -141,10 +141,16 @@ 
     virtual void release()
     {
         /* Release resources */
-        glDeleteTextures(1, &texture_);
-        glDeleteFramebuffers(1, &fbo_);
-        texture_ = 0;
-        fbo_ = 0;
+        if (texture_ != 0)
+        {
+            glDeleteTextures(1, &texture_);
+            texture_ = 0;
+        }
+        if (fbo_ != 0)
+        {
+            glDeleteFramebuffers(1, &fbo_);
+            fbo_ = 0;
+        }
 
         /* 
          * Release the shader program when object of this class