From 6237066af640d63aac9081c9e0ab160ad44ed7ac Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Sun, 11 Mar 2018 19:52:00 +0000 Subject: [PATCH] Don't wait for Journal thread on exit since can cause deadlock. Fixes #295 --- EDMarketConnector.py | 4 ++-- monitor.py | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index a0474e6e..28663e43 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -873,7 +873,7 @@ if __name__ == "__main__": GetWindowTextLength = ctypes.windll.user32.GetWindowTextLengthW GetProcessHandleFromHwnd = ctypes.windll.oleacc.GetProcessHandleFromHwnd SetForegroundWindow = ctypes.windll.user32.SetForegroundWindow - ShowWindow = ctypes.windll.user32.ShowWindow + ShowWindowAsync = ctypes.windll.user32.ShowWindowAsync def WindowTitle(h): if h: @@ -888,7 +888,7 @@ if __name__ == "__main__": cls = ctypes.create_unicode_buffer(257) if GetClassName(hWnd, cls, 257) and cls.value == 'TkTopLevel' and WindowTitle(hWnd) == applongname and GetProcessHandleFromHwnd(hWnd): # If GetProcessHandleFromHwnd succeeds then the app is already running as this user - ShowWindow(hWnd, 9) # SW_RESTORE + ShowWindowAsync(hWnd, 9) # SW_RESTORE SetForegroundWindow(hWnd) sys.exit(0) return True diff --git a/monitor.py b/monitor.py index 438daf8c..21510dd7 100644 --- a/monitor.py +++ b/monitor.py @@ -196,8 +196,6 @@ class EDLogs(FileSystemEventHandler): self.stop() if self.observer: self.observer.stop() - if thread: - thread.join() if self.observer: self.observer.join() self.observer = None