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; };