From 4911443d364e38bf93915cf9587f5cf8791cb30d Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Tue, 6 Oct 2009 13:18:09 +1000 Subject: nouveau: fix buffer object leak Very apparent with resizing windows on DRI2. --- src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/gallium/winsys/drm/nouveau') 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 8b531830f4f..f512c0e5f32 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 -- cgit v1.2.3