From 00ed40dbfd86c0f51d20b06624d7394656185409 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 24 Mar 2023 15:00:43 -0300 Subject: [PATCH] validate: scenario: Add a vmethod to free GstValidateActionParameter-s Part-of: --- .../validate/gst/validate/gst-validate-scenario.c | 6 ++++++ .../validate/gst/validate/gst-validate-scenario.h | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c b/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c index 232b7858b9..7a1c01e714 100644 --- a/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c +++ b/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c @@ -607,6 +607,12 @@ struct _GstValidateActionTypePrivate static void _action_type_free (GstValidateActionType * type) { + for (gint i = 0; type->parameters[i].name; i++) { + if (type->parameters[i].free) { + type->parameters[i].free (&type->parameters[i]); + } + } + g_free (type->parameters); g_free (type->description); g_free (type->name); diff --git a/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.h b/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.h index b4a28f4254..7f18cf2dd4 100644 --- a/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.h +++ b/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.h @@ -318,8 +318,17 @@ struct _GstValidateActionParameter const gchar *possible_variables; const gchar *def; + /** + * GstValidateActionParameter.free: + * + * Function that frees the various members of the structure when done using + * + * Since: 1.24 + */ + GDestroyNotify free; + /*< private >*/ - gpointer _gst_reserved[GST_PADDING]; + gpointer _gst_reserved[GST_PADDING - 1]; }; struct _GstValidateScenarioClass