From efdc9b1aeae61eb745c9782d7e928703c46ce6d8 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sat, 14 Jun 2025 09:47:20 -0400 Subject: [PATCH] validate: scenario: Clear wait_message_action on stop When executing a stop action, ensure that any pending wait_message_action is cleared and unreffed to prevent it from being executed after the scenario has been stopped. This prevents potential crashes or unexpected behavior when stopping a scenario that has a pending wait action. Part-of: --- .../validate/gst/validate/gst-validate-scenario.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 fd16cefe35..a465555392 100644 --- a/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c +++ b/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c @@ -7135,6 +7135,12 @@ _execute_stop (GstValidateScenario * scenario, GstValidateAction * action) } scenario->priv->has_stopped = TRUE; + if (scenario->priv->wait_message_action) { + // Clear the wait action so that it is not executed + gst_validate_action_unref (scenario->priv->wait_message_action); + scenario->priv->wait_message_action = NULL; + } + if (scenario->priv->actions || scenario->priv->non_blocking_running_actions || scenario->priv->on_addition_actions) { guint nb_actions = 0;