From 21a2b26bb2087de5ba861c9c32769f8749838ee9 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 26 Apr 2016 16:02:14 +0300 Subject: [PATCH] capsfeature: add cleanup priv function Those are allocated in _priv_gst_caps_features_initialize() so it makes sense to have a symetric cleanup functions called by gst_deinit(). https://bugzilla.gnome.org/show_bug.cgi?id=765606 --- gst/gst.c | 1 + gst/gst_private.h | 1 + gst/gstcapsfeatures.c | 12 ++++++++++++ 3 files changed, 14 insertions(+) diff --git a/gst/gst.c b/gst/gst.c index 6973ad40c9..ca99a47d3f 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -991,6 +991,7 @@ gst_deinit (void) _priv_gst_registry_cleanup (); _priv_gst_allocator_cleanup (); + _priv_gst_caps_features_cleanup (); #ifndef GST_DISABLE_TRACE _priv_gst_alloc_trace_deinit (); diff --git a/gst/gst_private.h b/gst/gst_private.h index 1060934ab9..efe55a1177 100644 --- a/gst/gst_private.h +++ b/gst/gst_private.h @@ -129,6 +129,7 @@ G_GNUC_INTERNAL void _priv_gst_date_time_initialize (void); /* cleanup functions called from gst_deinit(). */ G_GNUC_INTERNAL void _priv_gst_allocator_cleanup (void); +G_GNUC_INTERNAL void _priv_gst_caps_features_cleanup (void); /* Private registry functions */ G_GNUC_INTERNAL diff --git a/gst/gstcapsfeatures.c b/gst/gstcapsfeatures.c index ea06f0cfa1..95e4baea44 100644 --- a/gst/gstcapsfeatures.c +++ b/gst/gstcapsfeatures.c @@ -105,6 +105,18 @@ _priv_gst_caps_features_initialize (void) &static_caps_features_parent_refcount); } +void +_priv_gst_caps_features_cleanup (void) +{ + gst_caps_features_set_parent_refcount (_gst_caps_features_any, NULL); + gst_caps_features_free (_gst_caps_features_any); + _gst_caps_features_any = NULL; + gst_caps_features_set_parent_refcount + (_gst_caps_features_memory_system_memory, NULL); + gst_caps_features_free (_gst_caps_features_memory_system_memory); + _gst_caps_features_memory_system_memory = NULL; +} + gboolean gst_is_caps_features (gconstpointer obj) {