appsrc: Fix memory leak with callback notify not being called in dispose

https://bugzilla.gnome.org/show_bug.cgi?id=733386
This commit is contained in:
Youness Alaoui 2014-07-18 21:19:03 -04:00 committed by Sebastian Dröge
parent 69552ed81b
commit 6b0063aab5

View file

@ -544,10 +544,18 @@ gst_app_src_dispose (GObject * obj)
GstAppSrc *appsrc = GST_APP_SRC_CAST (obj);
GstAppSrcPrivate *priv = appsrc->priv;
GST_OBJECT_LOCK (appsrc);
if (priv->caps) {
gst_caps_unref (priv->caps);
priv->caps = NULL;
}
if (priv->notify) {
priv->notify (priv->user_data);
}
priv->user_data = NULL;
priv->notify = NULL;
GST_OBJECT_UNLOCK (appsrc);
gst_app_src_flush_queued (appsrc);
G_OBJECT_CLASS (parent_class)->dispose (obj);