From e0317288ba75ec5ff41f12a834c76d74ca390e2c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Olivier=20Cr=C3=AAte?= Date: Wed, 4 Dec 2013 17:35:02 -0500 Subject: [PATCH] info: Protect __categories list in get_category with lock too --- gst/gstinfo.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gst/gstinfo.c b/gst/gstinfo.c index 838091c..ab454b5 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -1674,8 +1674,8 @@ gst_debug_get_all_categories (void) return ret; } -GstDebugCategory * -_gst_debug_get_category (const gchar * name) +static GstDebugCategory * +_gst_debug_get_category_locked (const gchar * name) { GstDebugCategory *ret = NULL; GSList *node; @@ -1689,6 +1689,18 @@ _gst_debug_get_category (const gchar * name) return NULL; } +GstDebugCategory * +_gst_debug_get_category (const gchar * name) +{ + GstDebugCategory *ret; + + g_mutex_lock (&__cat_mutex); + ret = _gst_debug_get_category_locked (name); + g_mutex_unlock (&__cat_mutex); + + return ret; +} + static gboolean parse_debug_category (gchar * str, const gchar ** category) { -- 2.7.4