Skip to content

Commit ca84cb5

Browse files
danirabbitlenemter
andauthored
LocationPanel: cleanup cancellables in destructor (#918)
Co-authored-by: Leo <lenemter@gmail.com>
1 parent adf5e0d commit ca84cb5

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

src/EventEdition/LocationPanel.vala

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,19 @@ public class Maya.View.EventEdition.LocationPanel : Gtk.Box {
130130
}
131131
}
132132

133-
destroy.connect (() => {
134-
if (search_cancellable != null)
135-
search_cancellable.cancel ();
136-
if (find_cancellable != null) {
137-
find_cancellable.cancel ();
138-
}
139-
});
140-
141133
location_entry.grab_focus ();
142134
}
143135

136+
~LocationPanel () {
137+
if (search_cancellable != null) {
138+
search_cancellable.cancel ();
139+
}
140+
141+
if (find_cancellable != null) {
142+
find_cancellable.cancel ();
143+
}
144+
}
145+
144146
/**
145147
* Save the values in the dialog into the component.
146148
*/

0 commit comments

Comments
 (0)