diff options
author | Michel Daenzer <daenzer@localhost.(none)> | 2007-09-14 15:51:00 +0100 |
---|---|---|
committer | Michel Daenzer <daenzer@localhost.(none)> | 2007-09-14 15:53:52 +0100 |
commit | d59c95bfae0402813a6b9a1242cdd971624c127a (patch) | |
tree | 4fa29f91fdf0facd1c7fa75fa56edebf3f9cca29 /src/mesa/drivers/dri | |
parent | c01a5ec3d63a2f414e2b6c5b31c80367943189b4 (diff) |
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.
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c | 8 |
1 files changed, 5 insertions, 3 deletions
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 668bedcbdab..2b2731446d2 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; + } } |