summaryrefslogtreecommitdiff
path: root/plugins/TopToolBar
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TopToolBar')
-rw-r--r--plugins/TopToolBar/src/toolbar.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp
index 87db903dc6..ba97fe87fe 100644
--- a/plugins/TopToolBar/src/toolbar.cpp
+++ b/plugins/TopToolBar/src/toolbar.cpp
@@ -596,7 +596,7 @@ int OnPluginUnload(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
-int OnModulesLoad(WPARAM wParam, LPARAM lParam)
+static int OnModulesLoad(WPARAM wParam, LPARAM lParam)
{
LoadAllSeparators();
LoadAllLButs();
@@ -615,6 +615,16 @@ int OnModulesLoad(WPARAM wParam, LPARAM lParam)
return 0;
}
+static int OnShutdown(WPARAM wParam, LPARAM lParam)
+{
+ if (g_ctrl && g_ctrl->hWnd) {
+ DestroyWindow(g_ctrl->hWnd);
+ g_ctrl->hWnd = NULL;
+ }
+
+ return 0;
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
static LRESULT CALLBACK TTBButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -657,6 +667,7 @@ int LoadToolbarModule()
HookEvent(ME_SYSTEM_MODULELOAD, OnPluginLoad);
HookEvent(ME_SYSTEM_MODULEUNLOAD, OnPluginUnload);
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoad);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, OnShutdown);
HookEvent(ME_SKIN2_ICONSCHANGED, OnIconChange);
HookEvent(ME_OPT_INITIALISE, TTBOptInit);