summaryrefslogtreecommitdiff
path: root/gst-libs/gst
diff options
context:
space:
mode:
authorWind Yuan <feng.yuan@intel.com>2012-10-30 13:15:45 +0800
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-12-17 14:56:11 +0100
commit72f045bedd8c64d7b82429a2373d3d61bc2ef0fa (patch)
treebb4dcbf185a6a353a345a7a548ae5ee3ddac912f /gst-libs/gst
parenta7b4916b5a13fe2ac6e6ca356ee7745db03d5c2c (diff)
videobuffer: fix memory leak for surface and image.
Fix reference leak of surface and image in GstVaapiVideoBuffer wrapper, thus resulting on actual memory leak of GstVaapiImage when using them for downloads/uploads from VA surfaces and more specifically surfaces when the pipeline is shutdown. i.e. vaTerminate() was never called because the resources were not unreferenced, and thus not deallocated in the end. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Diffstat (limited to 'gst-libs/gst')
-rw-r--r--gst-libs/gst/vaapi/gstvaapivideobuffer.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapivideobuffer.c b/gst-libs/gst/vaapi/gstvaapivideobuffer.c
index 0a108535..cd1c948b 100644
--- a/gst-libs/gst/vaapi/gstvaapivideobuffer.c
+++ b/gst-libs/gst/vaapi/gstvaapivideobuffer.c
@@ -86,8 +86,7 @@ gst_vaapi_video_buffer_destroy_image(GstVaapiVideoBuffer *buffer)
if (priv->image) {
if (priv->image_pool)
gst_vaapi_video_pool_put_object(priv->image_pool, priv->image);
- else
- g_object_unref(priv->image);
+ g_object_unref(priv->image);
priv->image = NULL;
}
@@ -104,8 +103,7 @@ gst_vaapi_video_buffer_destroy_surface(GstVaapiVideoBuffer *buffer)
if (priv->surface) {
if (priv->surface_pool)
gst_vaapi_video_pool_put_object(priv->surface_pool, priv->surface);
- else
- g_object_unref(priv->surface);
+ g_object_unref(priv->surface);
priv->surface = NULL;
}