SHA256
1
0
forked from pool/Mesa
Mesa/bug-211314-patch-4.diff

25 lines
717 B
Diff
Raw Normal View History

commit 1a6baf092b4c31d5fd30c934f1a17d69c9689f12
Author: Brian <brian@yutani.localnet.net>
Date: Tue Mar 6 16:26:02 2007 -0700
unreference old framebuffer, if needed, in _mesa_reference_framebuffer()
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index c97d2f0..3136a95 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -253,6 +253,13 @@ _mesa_reference_framebuffer(struct gl_fr
struct gl_framebuffer *fb)
{
assert(ptr);
+ if (*ptr == fb) {
+ /* no change */
+ return;
+ }
+ if (*ptr) {
+ _mesa_unreference_framebuffer(ptr);
+ }
assert(!*ptr);
assert(fb);
_glthread_LOCK_MUTEX(fb->Mutex);