mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 15:27:07 +00:00
info: Make sure the same category is not added twice
This commit is contained in:
parent
e0317288ba
commit
ccba91308d
1 changed files with 10 additions and 1 deletions
|
@ -248,6 +248,9 @@ LevelNameEntry;
|
||||||
static GMutex __cat_mutex;
|
static GMutex __cat_mutex;
|
||||||
static GSList *__categories = NULL;
|
static GSList *__categories = NULL;
|
||||||
|
|
||||||
|
static GstDebugCategory *_gst_debug_get_category_locked (const gchar * name);
|
||||||
|
|
||||||
|
|
||||||
/* all registered debug handlers */
|
/* all registered debug handlers */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
@ -1523,7 +1526,13 @@ _gst_debug_category_new (const gchar * name, guint color,
|
||||||
|
|
||||||
/* add to category list */
|
/* add to category list */
|
||||||
g_mutex_lock (&__cat_mutex);
|
g_mutex_lock (&__cat_mutex);
|
||||||
|
if (_gst_debug_get_category_locked (name)) {
|
||||||
|
g_free ((gpointer) cat->name);
|
||||||
|
g_free ((gpointer) cat->description);
|
||||||
|
g_slice_free (GstDebugCategory, cat);
|
||||||
|
} else {
|
||||||
__categories = g_slist_prepend (__categories, cat);
|
__categories = g_slist_prepend (__categories, cat);
|
||||||
|
}
|
||||||
g_mutex_unlock (&__cat_mutex);
|
g_mutex_unlock (&__cat_mutex);
|
||||||
|
|
||||||
return cat;
|
return cat;
|
||||||
|
|
Loading…
Reference in a new issue