summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-11-07 08:57:56 -0700
committerBrian <brian.paul@tungstengraphics.com>2007-11-07 08:57:56 -0700
commit5d9021554ee78699933ddf79e5231cded6f9c641 (patch)
tree481e21bc680e93012407cae90bdbb3cf33985735
parentc3e7bb4127b74db0037d5a25340793273f5c3183 (diff)
redo xm_surface_release() to match i915
-rw-r--r--src/mesa/pipe/xlib/xm_winsys.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/pipe/xlib/xm_winsys.c b/src/mesa/pipe/xlib/xm_winsys.c
index d737e984d1..506923784c 100644
--- a/src/mesa/pipe/xlib/xm_winsys.c
+++ b/src/mesa/pipe/xlib/xm_winsys.c
@@ -300,9 +300,12 @@ static void
xm_surface_release(struct pipe_winsys *winsys, struct pipe_surface **s)
{
struct pipe_surface *surf = *s;
- if (surf->region)
- winsys->region_release(winsys, &surf->region);
- free(surf);
+ surf->refcount--;
+ if (surf->refcount == 0) {
+ if (surf->region)
+ winsys->region_release(winsys, &surf->region);
+ free(surf);
+ }
*s = NULL;
}