1
0
Fork 0
mirror of synced 2024-06-26 18:20:50 +12:00

Fix game finished signal, if rare exited

This commit is contained in:
Dummerle 2022-04-04 23:12:21 +02:00
parent 97214d5267
commit 57f10b7ec0
No known key found for this signature in database
GPG key ID: AB68CC59CA39F2F1

View file

@ -27,12 +27,16 @@ class GameProcess(QProcess):
def __init__(self, app_name):
super(GameProcess, self).__init__()
self.app_name = app_name
self.finished.connect(self._game_finished)
def _game_finished(self, exit_code):
try:
self.finished.connect(lambda x: self.game_finished.emit(x, self.app_name))
self.game_finished.emit(exit_code, self.app_name)
except RuntimeError: # Do not raise an exception, if rare finished, but game not
pass
@dataclass
class RunningGameModel:
process: GameProcess