summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2020-12-08 11:46:37 -0300
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-12-08 16:47:15 +0000
commit9eb7df7fef948dbfefbd31dc54ce9a467d2579f2 (patch)
tree2bf37a5fdb1643f03aa45dff056108d1f5cb7cb8
parentaca781f981112fb1159c8bbed8b26b12ec308123 (diff)
validate:scenario: Fix the refcount management for actions in structures
Handling the refcounting the same whether the action is blocking or not as we were leaking a ref for non-blocking waits. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-devtools/-/merge_requests/231>
-rw-r--r--validate/gst/validate/gst-validate-scenario.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c
index 38a1fbe..bf463f8 100644
--- a/validate/gst/validate/gst-validate-scenario.c
+++ b/validate/gst/validate/gst-validate-scenario.c
@@ -2749,7 +2749,8 @@ stop_waiting_signal (GstStructure * data)
GstValidateScenario *scenario;
gst_structure_get (data, "target", G_TYPE_POINTER, &target,
- "action", G_TYPE_POINTER, &action, "sigid", G_TYPE_UINT, &sigid, NULL);
+ "action", GST_TYPE_VALIDATE_ACTION, &action, "sigid", G_TYPE_UINT, &sigid,
+ NULL);
gst_structure_free (data);
scenario = gst_validate_action_get_scenario (action);
@@ -2765,6 +2766,7 @@ stop_waiting_signal (GstStructure * data)
SCENARIO_UNLOCK (scenario);
gst_validate_action_set_done (action);
+ gst_validate_action_unref (action);
_add_execute_actions_gsource (scenario);
gst_object_unref (scenario);
gst_object_unref (target);
@@ -2845,8 +2847,8 @@ _execute_wait_for_signal (GstValidateScenario * scenario,
}
data =
- gst_structure_new ("a", "action", G_TYPE_POINTER, action, "target",
- G_TYPE_POINTER, target, NULL);
+ gst_structure_new ("a", "action", GST_TYPE_VALIDATE_ACTION, action,
+ "target", G_TYPE_POINTER, target, NULL);
SCENARIO_LOCK (scenario);
priv->signal_handler_id = g_signal_connect_swapped (target, signal_name,
(GCallback) stop_waiting_signal, data);
@@ -2855,7 +2857,6 @@ _execute_wait_for_signal (GstValidateScenario * scenario,
gst_structure_get_boolean (action->structure, "non-blocking",
&non_blocking);
if (non_blocking) {
- gst_validate_action_ref (action);
gst_structure_set (data, "sigid", G_TYPE_UINT, priv->signal_handler_id,
NULL);
priv->signal_handler_id = 0;