info: Protect __categories list in get_category with lock too

This commit is contained in:
Olivier Crête 2013-12-04 17:35:02 -05:00
parent 249a775d2b
commit e0317288ba

View file

@ -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)
{