From eb0c83d34a85557573c9a9bf80d5e29c52711ef2 Mon Sep 17 00:00:00 2001 From: Leonhard Kargl Date: Tue, 17 Dec 2024 15:46:21 +0100 Subject: [PATCH] Fix leak --- src/Gestures/GesturePropertyTransition.vala | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Gestures/GesturePropertyTransition.vala b/src/Gestures/GesturePropertyTransition.vala index 326cfeaf3..019c3529a 100644 --- a/src/Gestures/GesturePropertyTransition.vala +++ b/src/Gestures/GesturePropertyTransition.vala @@ -122,11 +122,7 @@ public class Gala.GesturePropertyTransition : Object { if (transition == null) { finish (cancel_action); } else { - transition.stopped.connect ((is_finished) => { - if (is_finished) { - finish (cancel_action); - } - }); + transition.stopped.connect ((is_finished) => finish (cancel_action, is_finished)); } }; @@ -153,8 +149,8 @@ public class Gala.GesturePropertyTransition : Object { } } - private void finish (bool cancel_action) { - if (done_callback != null) { + private void finish (bool cancel_action, bool callback = true) { + if (callback && done_callback != null) { done_callback (cancel_action); }