From bd575670472e9256322ffc05bc06c8354c79858f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Wed, 4 Feb 2026 11:24:09 -0800 Subject: [PATCH] LocationPanel: cleanup cancellables in destructor --- src/EventEdition/LocationPanel.vala | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/EventEdition/LocationPanel.vala b/src/EventEdition/LocationPanel.vala index be47e11d9..e729d97c5 100644 --- a/src/EventEdition/LocationPanel.vala +++ b/src/EventEdition/LocationPanel.vala @@ -130,17 +130,19 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box { } } - destroy.connect (() => { - if (search_cancellable != null) - search_cancellable.cancel (); - if (find_cancellable != null) { - find_cancellable.cancel (); - } - }); - location_entry.grab_focus (); } + ~LocationPanel () { + if (search_cancellable != null) { + search_cancellable.cancel (); + } + + if (find_cancellable != null) { + find_cancellable.cancel (); + } + } + /** * Save the values in the dialog into the component. */