Fixed user_buffer memory leak
authorJakob Bornecrantz <jakob@tungstengraphics.com>
Tue, 8 Apr 2008 09:26:52 +0000 (11:26 +0200)
committerJakob Bornecrantz <jakob@tungstengraphics.com>
Tue, 8 Apr 2008 09:26:52 +0000 (11:26 +0200)
src/gallium/winsys/dri/intel/intel_winsys_pipe.c
src/gallium/winsys/dri/intel/ws_dri_bufmgr.c

index 59729a0245db1bed311dc2118169b4468253239e..40902197e1a014d92a390af9e6850f8a0375a5d0 100644 (file)
@@ -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;
 }
index eb5216cb3721de5d546583586ae62d9134906887..bf387f672b388995c1752a56a3f075d040f93223 100644 (file)
@@ -431,7 +431,6 @@ driBOUnReference(struct _DriBufferObject *buf)
    if (!buf)
       return;
 
-
    _glthread_LOCK_MUTEX(buf->mutex);
    tmp = --buf->refCount;
    if (!tmp) {