diff --git a/src/EventEdition/LocationPanel.vala b/src/EventEdition/LocationPanel.vala index 38f17b2fc..a426a63cd 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. */