summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-07-11 16:29:02 +0200
committerChristian König <[email protected]>2011-07-11 16:29:02 +0200
commitdf5e0b9435c869f88234a69db9bfe97342b027d4 (patch)
treedba46740cec2d3da73fd6d9522af7d2b770162c0 /src/gallium/state_trackers
parenta7ec477ebc8b256381854f1cef0ec03a2d713555 (diff)
[g3dvl] fix a whole bunch of memory leaks
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/vdpau/device.c3
-rw-r--r--src/gallium/state_trackers/vdpau/output.c5
-rw-r--r--src/gallium/state_trackers/vdpau/presentation.c2
-rw-r--r--src/gallium/state_trackers/xorg/xvmc/surface.c4
4 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/vdpau/device.c b/src/gallium/state_trackers/vdpau/device.c
index b032e83dc80..200d5f62f63 100644
--- a/src/gallium/state_trackers/vdpau/device.c
+++ b/src/gallium/state_trackers/vdpau/device.c
@@ -151,6 +151,9 @@ vlVdpDeviceDestroy(VdpDevice device)
vlVdpDevice *dev = vlGetDataHTAB(device);
if (!dev)
return VDP_STATUS_INVALID_HANDLE;
+
+ vl_video_destroy(dev->context);
+ vl_screen_destroy(dev->vscreen);
FREE(dev);
vlDestroyHTAB();
diff --git a/src/gallium/state_trackers/vdpau/output.c b/src/gallium/state_trackers/vdpau/output.c
index f67d6ccff6b..bc4b39ae75c 100644
--- a/src/gallium/state_trackers/vdpau/output.c
+++ b/src/gallium/state_trackers/vdpau/output.c
@@ -88,6 +88,7 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
vlsurface->sampler_view = pipe->create_sampler_view(pipe, res, &sv_templ);
if (!vlsurface->sampler_view) {
+ pipe_resource_reference(&res, NULL);
FREE(dev);
return VDP_STATUS_ERROR;
}
@@ -97,15 +98,19 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
surf_templ.usage = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
vlsurface->surface = pipe->create_surface(pipe, res, &surf_templ);
if (!vlsurface->surface) {
+ pipe_resource_reference(&res, NULL);
FREE(dev);
return VDP_STATUS_ERROR;
}
*surface = vlAddDataHTAB(vlsurface);
if (*surface == 0) {
+ pipe_resource_reference(&res, NULL);
FREE(dev);
return VDP_STATUS_ERROR;
}
+
+ pipe_resource_reference(&res, NULL);
return VDP_STATUS_OK;
}
diff --git a/src/gallium/state_trackers/vdpau/presentation.c b/src/gallium/state_trackers/vdpau/presentation.c
index 16beb289c42..1176c7a30b7 100644
--- a/src/gallium/state_trackers/vdpau/presentation.c
+++ b/src/gallium/state_trackers/vdpau/presentation.c
@@ -192,6 +192,8 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
if (system(cmd) != 0)
VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Dumping surface %d failed.\n", surface);
}
+
+ pipe_surface_reference(&drawable_surface, NULL);
return VDP_STATUS_OK;
}
diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c
index e8ca8152e7a..aef1eff2bb3 100644
--- a/src/gallium/state_trackers/xorg/xvmc/surface.c
+++ b/src/gallium/state_trackers/xorg/xvmc/surface.c
@@ -522,6 +522,7 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable,
context_priv->dst_rect.x != dst_rect.x || context_priv->dst_rect.y != dst_rect.y ||
context_priv->dst_rect.w != dst_rect.w || context_priv->dst_rect.h != dst_rect.h) {
+ pipe_surface_reference(&context_priv->drawable_surface, NULL);
context_priv->drawable_surface = vl_drawable_surface_get(context_priv->vctx, drawable);
context_priv->dst_rect = dst_rect;
vl_compositor_reset_dirty_area(compositor);
@@ -636,6 +637,9 @@ Status XvMCDestroySurface(Display *dpy, XvMCSurface *surface)
return XvMCBadSurface;
surface_priv = surface->privData;
+
+ if (surface_priv->mapped)
+ surface_priv->decode_buffer->end_frame(surface_priv->decode_buffer);
surface_priv->decode_buffer->destroy(surface_priv->decode_buffer);
surface_priv->video_buffer->destroy(surface_priv->video_buffer);
FREE(surface_priv);