From 1a6baf092b4c31d5fd30c934f1a17d69c9689f12 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 6 Mar 2007 16:26:02 -0700 Subject: [PATCH] unreference old framebuffer, if needed, in _mesa_reference_framebuffer() --- src/mesa/main/framebuffer.c | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- 2.30.2