diff options
author | Brian <[email protected]> | 2007-11-07 08:57:56 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-11-07 08:57:56 -0700 |
commit | 5d9021554ee78699933ddf79e5231cded6f9c641 (patch) | |
tree | 481e21bc680e93012407cae90bdbb3cf33985735 /src/mesa/pipe | |
parent | c3e7bb4127b74db0037d5a25340793273f5c3183 (diff) |
redo xm_surface_release() to match i915
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r-- | src/mesa/pipe/xlib/xm_winsys.c | 9 |
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 d737e984d1c..506923784c5 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; } |