From ca94703fc3c7df95500d1c4dd8d2ac91f1267399 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Wed, 18 Mar 2020 03:21:00 +0100 Subject: [PATCH] Fix tray icon destroy overflow exception --- plugins/Trayicon/lib/notificationicon.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/Trayicon/lib/notificationicon.py b/plugins/Trayicon/lib/notificationicon.py index 57a4ddd6..8b913f83 100644 --- a/plugins/Trayicon/lib/notificationicon.py +++ b/plugins/Trayicon/lib/notificationicon.py @@ -566,10 +566,11 @@ class NotificationIcon(object): # print "NotificationIcon error", err, message message = MSG() time.sleep(0.125) - print("Icon thread stopped, removing icon...") + print("Icon thread stopped, removing icon (hicon: %s, hwnd: %s)..." % (self._hicon, self._hwnd)) Shell_NotifyIcon(NIM_DELETE, ctypes.cast(ctypes.pointer(iconinfo), ctypes.POINTER(NOTIFYICONDATA))) ctypes.windll.user32.DestroyWindow(self._hwnd) + ctypes.windll.user32.DestroyIcon.argtypes = [ctypes.wintypes.HICON] ctypes.windll.user32.DestroyIcon(self._hicon)