Fix race condition on stopping.

This commit is contained in:
Jonathan Harris committed 2016-01-31 12:44:39 +00:00
1 parent bf24f8460b
commit da87eb71e6
1 file changed
+5 -4
+5 -4
View File
@@ -296,10 +296,11 @@ elif platform == 'win32':
self.thread.start()
def unregister(self):
if self.thread:
PostThreadMessage(self.thread.ident, WM_QUIT, 0, 0)
self.thread.join() # Wait for it to unregister hotkey and quit
self.thread = None
thread = self.thread
if thread:
self.thread = None
PostThreadMessage(thread.ident, WM_QUIT, 0, 0)
thread.join() # Wait for it to unregister hotkey and quit
def worker(self, keycode, modifiers):