return cat;
}
+#ifndef GST_REMOVE_DEPRECATED
/**
* gst_debug_category_free:
* @category: #GstDebugCategory to free.
*
* Removes and frees the category and all associated resources.
+ *
+ * Deprecated: This function can easily cause memory corruption, don't use it.
*/
void
gst_debug_category_free (GstDebugCategory * category)
{
- if (category == NULL)
- return;
-
- /* remove from category list */
- g_mutex_lock (&__cat_mutex);
- __categories = g_slist_remove (__categories, category);
- g_mutex_unlock (&__cat_mutex);
-
- g_free ((gpointer) category->name);
- g_free ((gpointer) category->description);
- g_slice_free (GstDebugCategory, category);
}
+#endif
/**
* gst_debug_category_set_threshold:
{
}
+#ifndef GST_REMOVE_DEPRECATED
void
gst_debug_category_free (GstDebugCategory * category)
{
}
+#endif
void
gst_debug_category_set_threshold (GstDebugCategory * category,
GST_API
void gst_debug_unset_threshold_for_name (const gchar * name);
-
-GST_API
+GST_DEPRECATED
void gst_debug_category_free (GstDebugCategory * category);
GST_API
#define GST_DEBUG_CATEGORY_INIT(var,name,color,desc) G_STMT_START{ }G_STMT_END
#define GST_DEBUG_CATEGORY_GET(var,name) G_STMT_START{ }G_STMT_END
+#ifndef GST_DISABLE_DEPRECATED
#define gst_debug_category_free(category) G_STMT_START{ }G_STMT_END
+#endif
#define gst_debug_category_set_threshold(category,level) G_STMT_START{ }G_STMT_END
#define gst_debug_category_reset_threshold(category) G_STMT_START{ }G_STMT_END
#define gst_debug_category_get_threshold(category) (GST_LEVEL_NONE)
fail_unless_equals_int (gst_debug_category_get_threshold (cats[0xb10]),
GST_LEVEL_LOG);
}
-
- for (i = 0; i < G_N_ELEMENTS (cats); ++i)
- gst_debug_category_free (cats[i]);
}
GST_END_TEST;