summaryrefslogtreecommitdiff
path: root/src/gallium
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2009-10-06 13:18:09 +1000
committerBen Skeggs <bskeggs@redhat.com>2009-10-06 13:31:43 +1000
commit4911443d364e38bf93915cf9587f5cf8791cb30d (patch)
treec9facb8a5e2294d96d37f8cfaadd9114c089e440 /src/gallium
parentdb8b363eb9fd03a377f8d1f1bab5b29c64a3caa7 (diff)
nouveau: fix buffer object leak
Very apparent with resizing windows on DRI2.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
index 8b531830f4..f512c0e5f3 100644
--- a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
+++ b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c
@@ -197,6 +197,7 @@ nouveau_drm_pt_from_name(struct drm_api *api, struct pipe_screen *pscreen,
unsigned stride, unsigned handle)
{
struct nouveau_device *dev = nouveau_screen(pscreen)->device;
+ struct pipe_texture *pt;
struct pipe_buffer *pb;
int ret;
@@ -218,7 +219,9 @@ nouveau_drm_pt_from_name(struct drm_api *api, struct pipe_screen *pscreen,
pb->usage = PIPE_BUFFER_USAGE_GPU_READ_WRITE |
PIPE_BUFFER_USAGE_CPU_READ_WRITE;
pb->size = nouveau_bo(pb)->size;
- return pscreen->texture_blanket(pscreen, templ, &stride, pb);
+ pt = pscreen->texture_blanket(pscreen, templ, &stride, pb);
+ pipe_buffer_reference(&pb, NULL);
+ return pt;
}
static boolean