v4l2bufferpool: don't ref the newly created allocator
authorMichael Olbrich <m.olbrich@pengutronix.de>
Fri, 17 Jan 2014 06:46:09 +0000 (07:46 +0100)
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>
Fri, 17 Jan 2014 13:32:28 +0000 (08:32 -0500)
Otherwise the allocator will never be deleted.

https://bugzilla.gnome.org/show_bug.cgi?id=712612

sys/v4l2/gstv4l2bufferpool.c

index 90a94b2..2e44864 100644 (file)
@@ -470,11 +470,13 @@ gst_v4l2_buffer_pool_set_config (GstBufferPool * bpool, GstStructure * config)
 
   if (obj->mode == GST_V4L2_IO_DMABUF)
     allocator = gst_dmabuf_allocator_new ();
+  else if (allocator)
+    gst_object_ref (allocator);
 
   if (pool->allocator)
     gst_object_unref (pool->allocator);
-  if ((pool->allocator = allocator))
-    gst_object_ref (allocator);
+  pool->allocator = allocator;
+
   pool->params = params;
 
   gst_buffer_pool_config_set_params (config, caps, size, min_buffers,