From: Michael Olbrich Date: Wed, 5 Jun 2013 14:32:30 +0000 (+0200) Subject: v4l2: make sure the element is not deleted before the pool X-Git-Tag: 1.19.3~509^2~5719 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1c34b540735a7a23b15cdb77ecba1b28adb93ee;p=platform%2Fupstream%2Fgstreamer.git v4l2: make sure the element is not deleted before the pool The pool accesses data from the v4l2object so it must exist at least as long as the pool. Refcount the element which controls the object live-time. https://bugzilla.gnome.org/show_bug.cgi?id=701650 --- diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index 34a444b..3ead390 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -1017,6 +1017,8 @@ gst_v4l2_buffer_pool_finalize (GObject * object) gst_object_unref (pool->allocator); g_free (pool->buffers); + gst_object_unref (pool->obj->element); + G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -1070,6 +1072,8 @@ gst_v4l2_buffer_pool_new (GstV4l2Object * obj, GstCaps * caps) gst_buffer_pool_config_set_params (s, caps, obj->sizeimage, 2, 0); gst_buffer_pool_set_config (GST_BUFFER_POOL_CAST (pool), s); + gst_object_ref (obj->element); + return GST_BUFFER_POOL (pool); /* ERRORS */