From: Michel Daenzer Date: Fri, 14 Sep 2007 14:51:00 +0000 (+0100) Subject: intel_winsys: Fix intel_buffer_reference. X-Git-Tag: 062012170305~17580^2~390^2~4118 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d59c95bfae0402813a6b9a1242cdd971624c127a;p=profile%2Fivi%2Fmesa.git intel_winsys: Fix intel_buffer_reference. Correctly clear the pointer to the old buffer (not sure how this could build at all before...) and only reference the new one when its pointer is non-NULL. --- diff --git a/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c b/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c index 668bedc..2b27314 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c @@ -91,11 +91,13 @@ intel_buffer_reference(struct pipe_winsys *sws, { if (*ptr) { driBOUnReference( dri_bo(*ptr) ); - *buf = NULL; + *ptr = NULL; } - driBOReference( dri_bo(buf) ); - *ptr = buf; + if (buf) { + driBOReference( dri_bo(buf) ); + *ptr = buf; + } }