Catch for game quit cleanup
This commit is contained in:
parent
904eb51d06
commit
a3b2380365
|
|
@ -18,6 +18,7 @@ class WatchPipe(QThread):
|
||||||
change_image = pyqtSignal(str)
|
change_image = pyqtSignal(str)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
while True:
|
||||||
while True:
|
while True:
|
||||||
if os.path.exists(pipe_path): break
|
if os.path.exists(pipe_path): break
|
||||||
else: time.sleep(0.1)
|
else: time.sleep(0.1)
|
||||||
|
|
@ -26,6 +27,7 @@ class WatchPipe(QThread):
|
||||||
pipe.flush()
|
pipe.flush()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
if not os.path.exists(pipe_path): break # Handle game quitting cleanup
|
||||||
message = os.read(pipe.fileno(), 256)
|
message = os.read(pipe.fileno(), 256)
|
||||||
if len(message) > 0:
|
if len(message) > 0:
|
||||||
self.change_image.emit(message.decode())
|
self.change_image.emit(message.decode())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue