transition: don't allow _return_error() to be called recursively

This commit is contained in:
George Kiagiadakis
2023-01-10 17:55:42 +02:00
committed by Julian Bouzas
parent 6495eb6d21
commit 18377fbf82

View File

@@ -488,10 +488,12 @@ wp_transition_return_error (WpTransition * self, GError * error)
WpTransitionPrivate *priv = wp_transition_get_instance_private (self);
/* don't allow _return_error() to be called multiple times,
as it is dangerous to recurse in execute_step() */
if (G_UNLIKELY (priv->error)) {
wp_warning_object (self, "transition bailing out multiple times; "
"old error was: %s", priv->error->message);
g_clear_error (&priv->error);
"new error is: %s", error->message);
return;
}
priv->step = WP_TRANSITION_STEP_ERROR;