summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-03-25 15:40:24 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-03-25 15:40:24 +0000
commitfbd147c0b5590d712ab517730e913d5619e268e8 (patch)
treea5af9080816ca9f09f70bcda518799c05c25a2ec
parent7b7c54e94ca1498108d2e6e657db4f9c39a6709f (diff)
unlock mutex before freeing data (caught w/ valgrind)
-rw-r--r--src/mesa/main/fbobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index b8386b7a59..569979791b 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -1036,10 +1036,10 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer)
if (oldFb && oldFb->Name != 0) {
_glthread_LOCK_MUTEX(oldFb->Mutex);
oldFb->RefCount--;
+ _glthread_UNLOCK_MUTEX(oldFb->Mutex);
if (oldFb->RefCount == 0) {
oldFb->Delete(oldFb);
}
- _glthread_UNLOCK_MUTEX(oldFb->Mutex);
}
ctx->ReadBuffer = newFb;
}
@@ -1102,10 +1102,10 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers)
*/
_glthread_LOCK_MUTEX(fb->Mutex);
fb->RefCount--;
+ _glthread_UNLOCK_MUTEX(fb->Mutex);
if (fb->RefCount == 0) {
fb->Delete(fb);
}
- _glthread_UNLOCK_MUTEX(fb->Mutex);
}
}
}