Remove the timeout that is pulsing the progress bar in the move-game dialog

Otherwise, it will keep pulsing forever, even though it's destroyed.
This commit is contained in:
Daniel Johnson 2023-12-23 14:55:24 -05:00
parent 2e555e9525
commit 8ae4f0d35d

View file

@ -556,9 +556,13 @@ class MoveDialog(ModelessDialog):
self.progress.set_pulse_step(0.1)
vbox.add(self.progress)
self.get_content_area().add(vbox)
GLib.timeout_add(125, self.show_progress)
self.progress_source_id = GLib.timeout_add(125, self.show_progress)
self.connect("destroy", self.on_destroy)
self.show_all()
def on_destroy(self, _dialog):
GLib.source_remove(self.progress_source_id)
def move(self):
AsyncCall(self._move_game, self.on_game_moved)