From 4c0f72432393e324d608474d24d20ebb465cb2ca Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 8 Apr 2008 11:26:52 +0200 Subject: [PATCH] Fixed user_buffer memory leak --- src/gallium/winsys/dri/intel/intel_winsys_pipe.c | 4 +++- src/gallium/winsys/dri/intel/ws_dri_bufmgr.c | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/winsys/dri/intel/intel_winsys_pipe.c b/src/gallium/winsys/dri/intel/intel_winsys_pipe.c index 59729a0245d..40902197e1a 100644 --- a/src/gallium/winsys/dri/intel/intel_winsys_pipe.c +++ b/src/gallium/winsys/dri/intel/intel_winsys_pipe.c @@ -156,7 +156,9 @@ intel_user_buffer_create(struct pipe_winsys *winsys, void *ptr, unsigned bytes) struct intel_pipe_winsys *iws = intel_pipe_winsys(winsys); driGenUserBuffer( iws->regionPool, - "pipe user buffer", &buffer->driBO, ptr, bytes ); + "pipe user buffer", &buffer->driBO, ptr, bytes ); + + buffer->base.refcount = 1; return &buffer->base; } diff --git a/src/gallium/winsys/dri/intel/ws_dri_bufmgr.c b/src/gallium/winsys/dri/intel/ws_dri_bufmgr.c index eb5216cb372..bf387f672b3 100644 --- a/src/gallium/winsys/dri/intel/ws_dri_bufmgr.c +++ b/src/gallium/winsys/dri/intel/ws_dri_bufmgr.c @@ -431,7 +431,6 @@ driBOUnReference(struct _DriBufferObject *buf) if (!buf) return; - _glthread_LOCK_MUTEX(buf->mutex); tmp = --buf->refCount; if (!tmp) { -- 2.30.2