mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
validate: Properly clear the overrides registry on deinit
Summary: Depends on D208 Reviewers: Mathieu_Du Differential Revision: http://phabricator.freedesktop.org/D209
This commit is contained in:
parent
2c6993b2bd
commit
6ddf55eaa2
3 changed files with 57 additions and 0 deletions
|
@ -43,5 +43,6 @@ void init_scenarios (void);
|
|||
* and this is done by the scenario itself now */
|
||||
GST_EXPORT gboolean _action_check_and_set_printed (GstValidateAction *action);
|
||||
GST_EXPORT gboolean gst_validate_action_is_subaction (GstValidateAction *action);
|
||||
void _priv_validate_override_registry_deinit (void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -57,6 +57,25 @@ static GstValidateOverrideRegistry *_registry_default = NULL;
|
|||
#define GST_VALIDATE_OVERRIDE_INIT_SYMBOL "gst_validate_create_overrides"
|
||||
typedef int (*GstValidateCreateOverride) (void);
|
||||
|
||||
static void
|
||||
gst_validate_override_registry_name_entry_free
|
||||
(GstValidateOverrideRegistryNameEntry * entry)
|
||||
{
|
||||
g_free (entry->name);
|
||||
gst_object_unref (entry->override);
|
||||
|
||||
g_slice_free (GstValidateOverrideRegistryNameEntry, entry);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_validate_override_registry_type_entry_free
|
||||
(GstValidateOverrideRegistryGTypeEntry * entry)
|
||||
{
|
||||
gst_object_unref (entry->override);
|
||||
|
||||
g_slice_free (GstValidateOverrideRegistryGTypeEntry, entry);
|
||||
}
|
||||
|
||||
static GstValidateOverrideRegistry *
|
||||
gst_validate_override_registry_new (void)
|
||||
{
|
||||
|
@ -70,6 +89,25 @@ gst_validate_override_registry_new (void)
|
|||
return reg;
|
||||
}
|
||||
|
||||
static void
|
||||
gst_validate_overide_registery_free (GstValidateOverrideRegistry * reg)
|
||||
{
|
||||
g_queue_foreach (®->klass_overrides,
|
||||
(GFunc) gst_validate_override_registry_name_entry_free, NULL);
|
||||
|
||||
g_queue_foreach (®->name_overrides,
|
||||
(GFunc) gst_validate_override_registry_name_entry_free, NULL);
|
||||
|
||||
g_queue_foreach (®->gtype_overrides,
|
||||
(GFunc) gst_validate_override_registry_type_entry_free, NULL);
|
||||
|
||||
g_queue_clear (®->name_overrides);
|
||||
g_queue_clear (®->gtype_overrides);
|
||||
g_queue_clear (®->klass_overrides);
|
||||
|
||||
g_slice_free (GstValidateOverrideRegistry, reg);
|
||||
}
|
||||
|
||||
GstValidateOverrideRegistry *
|
||||
gst_validate_override_registry_get (void)
|
||||
{
|
||||
|
@ -407,3 +445,19 @@ GList *gst_validate_override_registry_get_override_for_names
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
_priv_validate_override_registry_deinit (void)
|
||||
{
|
||||
GstValidateOverrideRegistry *reg = NULL;
|
||||
|
||||
g_mutex_lock (&_gst_validate_override_registry_mutex);
|
||||
if (G_UNLIKELY (_registry_default)) {
|
||||
reg = _registry_default;
|
||||
_registry_default = NULL;
|
||||
}
|
||||
g_mutex_unlock (&_gst_validate_override_registry_mutex);
|
||||
|
||||
if (reg)
|
||||
gst_validate_overide_registery_free (reg);
|
||||
}
|
||||
|
|
|
@ -267,6 +267,8 @@ void
|
|||
gst_validate_deinit (void)
|
||||
{
|
||||
_free_plugin_config (core_config);
|
||||
gst_object_unref (_gst_validate_registry_default);
|
||||
_priv_validate_override_registry_deinit ();
|
||||
core_config = NULL;
|
||||
validate_initialized = FALSE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue