From: Brian Date: Tue, 6 Mar 2007 23:26:02 +0000 (-0700) Subject: unreference old framebuffer, if needed, in _mesa_reference_framebuffer() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1a6baf092b4c31d5fd30c934f1a17d69c9689f12;p=mesa.git unreference old framebuffer, if needed, in _mesa_reference_framebuffer() --- 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);