From 8daad351a46e6e049fd7f0d8acd2f4b986a1bd87 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 26 Apr 2016 16:02:14 +0300 Subject: [PATCH] caps: add cleanup priv function Those are allocated in _priv_gst_caps_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/gstcaps.c | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/gst/gst.c b/gst/gst.c index ca99a47d3f..43abeb1273 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -992,6 +992,7 @@ gst_deinit (void) _priv_gst_registry_cleanup (); _priv_gst_allocator_cleanup (); _priv_gst_caps_features_cleanup (); + _priv_gst_caps_cleanup (); #ifndef GST_DISABLE_TRACE _priv_gst_alloc_trace_deinit (); diff --git a/gst/gst_private.h b/gst/gst_private.h index efe55a1177..25bed74a9a 100644 --- a/gst/gst_private.h +++ b/gst/gst_private.h @@ -130,6 +130,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); +G_GNUC_INTERNAL void _priv_gst_caps_cleanup (void); /* Private registry functions */ G_GNUC_INTERNAL diff --git a/gst/gstcaps.c b/gst/gstcaps.c index e2145b32c9..c7d990b92a 100644 --- a/gst/gstcaps.c +++ b/gst/gstcaps.c @@ -145,6 +145,15 @@ _priv_gst_caps_initialize (void) G_TYPE_STRING, gst_caps_transform_to_string); } +void +_priv_gst_caps_cleanup (void) +{ + gst_caps_unref (_gst_caps_any); + _gst_caps_any = NULL; + gst_caps_unref (_gst_caps_none); + _gst_caps_none = NULL; +} + GstCapsFeatures * __gst_caps_get_features_unchecked (const GstCaps * caps, guint idx) {