diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index 921a848f0e..071a109351 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -2965,6 +2965,11 @@ gst_base_src_set_allocation (GstBaseSrc * basesrc, GstBufferPool * pool, oldalloc = priv->allocator; priv->allocator = allocator; + if (priv->pool) + gst_object_ref (priv->pool); + if (priv->allocator) + gst_object_ref (priv->allocator); + if (params) priv->params = *params; else @@ -3141,6 +3146,11 @@ gst_base_src_prepare_allocation (GstBaseSrc * basesrc, GstCaps * caps) result = gst_base_src_set_allocation (basesrc, pool, allocator, ¶ms); + if (allocator) + gst_object_unref (allocator); + if (pool) + gst_object_unref (pool); + gst_query_unref (query); return result;