mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
added try except of Attribute error to catch not existing thread error
This commit is contained in:
parent
ff44a00354
commit
744a606d69
1 changed files with 16 additions and 6 deletions
|
|
@ -70,12 +70,22 @@ class IdleManager(QtCore.QThread):
|
|||
|
||||
if self.qaction and self.failed_icon:
|
||||
self.qaction.setIcon(self.failed_icon)
|
||||
thread_mouse.signal_stop.emit()
|
||||
thread_mouse.terminate()
|
||||
thread_mouse.wait()
|
||||
thread_keyboard.signal_stop.emit()
|
||||
thread_keyboard.terminate()
|
||||
thread_keyboard.wait()
|
||||
|
||||
# Threads don't have their attrs when Qt application already finished
|
||||
try:
|
||||
thread_mouse.signal_stop.emit()
|
||||
thread_mouse.terminate()
|
||||
thread_mouse.wait()
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
try:
|
||||
thread_keyboard.signal_stop.emit()
|
||||
thread_keyboard.terminate()
|
||||
thread_keyboard.wait()
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
self._is_running = False
|
||||
self.log.info('IdleManager has stopped')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue