diff --git a/sys/v4l2/gstv4l2allocator.c b/sys/v4l2/gstv4l2allocator.c index 20473830ae..5a5f2b86b8 100644 --- a/sys/v4l2/gstv4l2allocator.c +++ b/sys/v4l2/gstv4l2allocator.c @@ -639,6 +639,7 @@ gst_v4l2_allocator_new (GstObject * parent, gint video_fd, g_free (parent_name); allocator = g_object_new (GST_TYPE_V4L2_ALLOCATOR, "name", name, NULL); + gst_object_ref_sink (allocator); g_free (name); /* Save everything */ diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index 48cda0f7ee..8b70b98dd2 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -1589,6 +1589,7 @@ gst_v4l2_buffer_pool_new (GstV4l2Object * obj, GstCaps * caps) pool = (GstV4l2BufferPool *) g_object_new (GST_TYPE_V4L2_BUFFER_POOL, "name", name, NULL); + g_object_ref_sink (pool); g_free (name); gst_poll_fd_init (&pool->pollfd);