diff options
author | Brian <[email protected]> | 2007-03-06 16:26:02 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-03-06 16:26:02 -0700 |
commit | 1a6baf092b4c31d5fd30c934f1a17d69c9689f12 (patch) | |
tree | 7aa0ae7ac226ddc95fcd6ba0f4675cbdc93e54c9 /src/mesa/main/framebuffer.c | |
parent | 955906aa647d0d233b422c979e1ee81dc32abb87 (diff) |
unreference old framebuffer, if needed, in _mesa_reference_framebuffer()
Diffstat (limited to 'src/mesa/main/framebuffer.c')
-rw-r--r-- | src/mesa/main/framebuffer.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index c97d2f0077b..3136a950e08 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -253,6 +253,13 @@ _mesa_reference_framebuffer(struct gl_framebuffer **ptr, 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); |