Catch for game quit cleanup

This commit is contained in:
Vinyl Darkscratch 2018-03-07 00:43:08 -08:00
parent 904eb51d06
commit a3b2380365

View file

@ -18,6 +18,7 @@ class WatchPipe(QThread):
change_image = pyqtSignal(str)
def run(self):
while True:
while True:
if os.path.exists(pipe_path): break
else: time.sleep(0.1)
@ -26,6 +27,7 @@ class WatchPipe(QThread):
pipe.flush()
while True:
if not os.path.exists(pipe_path): break # Handle game quitting cleanup
message = os.read(pipe.fileno(), 256)
if len(message) > 0:
self.change_image.emit(message.decode())