From: Christian König Date: Wed, 7 Mar 2012 13:51:46 +0000 (+0100) Subject: st/vdpau: fix two small memory leaks X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9a3c2776acef1950a752e109eedd282a40edaf66;p=mesa.git st/vdpau: fix two small memory leaks Signed-off-by: Christian König --- diff --git a/src/gallium/state_trackers/vdpau/device.c b/src/gallium/state_trackers/vdpau/device.c index 5af1570d5ae..2e38f6cdadb 100644 --- a/src/gallium/state_trackers/vdpau/device.c +++ b/src/gallium/state_trackers/vdpau/device.c @@ -292,8 +292,8 @@ vlVdpResolveDelayedRendering(vlVdpDevice *dev, struct pipe_surface *surface, str struct pipe_sampler_view sv_templ; vlVdpDefaultSamplerViewTemplate(&sv_templ, res); - pipe_sampler_view_reference(&vlsurface->sampler_view, - dev->context->create_sampler_view(dev->context, res, &sv_templ)); + pipe_sampler_view_reference(&vlsurface->sampler_view, NULL); + vlsurface->sampler_view = dev->context->create_sampler_view(dev->context, res, &sv_templ); } return; diff --git a/src/gallium/state_trackers/vdpau/output.c b/src/gallium/state_trackers/vdpau/output.c index 7e3d74d8011..5b25e63d28e 100644 --- a/src/gallium/state_trackers/vdpau/output.c +++ b/src/gallium/state_trackers/vdpau/output.c @@ -133,16 +133,20 @@ VdpStatus vlVdpOutputSurfaceDestroy(VdpOutputSurface surface) { vlVdpOutputSurface *vlsurface; + struct pipe_context *pipe; vlsurface = vlGetDataHTAB(surface); if (!vlsurface) return VDP_STATUS_INVALID_HANDLE; + pipe = vlsurface->device->context; + pipe_mutex_lock(vlsurface->device->mutex); vlVdpResolveDelayedRendering(vlsurface->device, NULL, NULL); pipe_surface_reference(&vlsurface->surface, NULL); pipe_sampler_view_reference(&vlsurface->sampler_view, NULL); + pipe->screen->fence_reference(pipe->screen, &vlsurface->fence, NULL); vl_compositor_cleanup_state(&vlsurface->cstate); pipe_mutex_unlock(vlsurface->device->mutex);