mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Shut down the sim update thread on quit.
Otherwise the update thread just sits there waiting forever...
This commit is contained in:
parent
03430a4df5
commit
de0b267568
@ -44,6 +44,9 @@ class SimController(QObject):
|
|||||||
self.recreate_game_loop(game)
|
self.recreate_game_loop(game)
|
||||||
self.sim_speed_reset.emit(SimSpeedSetting.PAUSED)
|
self.sim_speed_reset.emit(SimSpeedSetting.PAUSED)
|
||||||
|
|
||||||
|
def shut_down(self) -> None:
|
||||||
|
self._sim_update_thread.stop()
|
||||||
|
|
||||||
def recreate_game_loop(self, game: Optional[Game]) -> None:
|
def recreate_game_loop(self, game: Optional[Game]) -> None:
|
||||||
if self.game_loop is not None:
|
if self.game_loop is not None:
|
||||||
self._sim_update_thread.on_sim_pause()
|
self._sim_update_thread.on_sim_pause()
|
||||||
|
|||||||
@ -389,6 +389,7 @@ class QLiberationWindow(QMainWindow):
|
|||||||
QMessageBox.Yes | QMessageBox.No,
|
QMessageBox.Yes | QMessageBox.No,
|
||||||
)
|
)
|
||||||
if result == QMessageBox.Yes:
|
if result == QMessageBox.Yes:
|
||||||
|
self.sim_controller.shut_down()
|
||||||
super().closeEvent(event)
|
super().closeEvent(event)
|
||||||
self.dialog = None
|
self.dialog = None
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user