From 6d4c0040f79f7b2e71897ca5c016267bfa2c019b Mon Sep 17 00:00:00 2001 From: foudfou Date: Sat, 22 Feb 2014 23:19:19 +0100 Subject: [PATCH] fix window unregistration --- src/modules/commons.js | 2 +- src/modules/winnt/FiretrayWindow.jsm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/commons.js b/src/modules/commons.js index f03c567..cd49ad8 100644 --- a/src/modules/commons.js +++ b/src/modules/commons.js @@ -297,7 +297,7 @@ firetray.js = { assert: function(condition, message) { if (!condition) { - throw message || "Assertion failed"; + throw new Error(message || "Assertion failed"); } }, diff --git a/src/modules/winnt/FiretrayWindow.jsm b/src/modules/winnt/FiretrayWindow.jsm index f0c8ee7..9b5a138 100644 --- a/src/modules/winnt/FiretrayWindow.jsm +++ b/src/modules/winnt/FiretrayWindow.jsm @@ -107,7 +107,7 @@ firetray.Window.detachWndProc = function(wid) { user32.SetWindowLongW(hwnd, user32.GWLP_WNDPROC, ctypes.cast(procPrev, win32.LONG_PTR)) ); - firetray.js.assert(proc == firetray.Handler.wndProcs.get(wid), + firetray.js.assert(firetray.js.strEquals(proc, firetray.Handler.wndProcs.get(wid)), "Wrong WndProc replaced."); firetray.Handler.wndProcs.remove(wid); firetray.Handler.wndProcsOrig.remove(wid); @@ -173,6 +173,7 @@ firetray.Handler.unregisterWindow = function(win) { if (!delete firetray.Handler.windows[wid]) throw new DeleteError(); + firetray.Handler.dumpWindows(); log.debug("window "+wid+" unregistered"); return true; };