diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-23 16:00:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-23 16:00:42 +0000 |
commit | bf737d86dbb6a4091086e8488f397db9ac120eb3 (patch) | |
tree | 4a014766d1308f3b976043ce2a23368b5a877d56 /plugins/CSList | |
parent | 19bdb2b703bf31917094cdee509f16401f9b4721 (diff) |
fix for dynamic CSList load/unload
git-svn-id: http://svn.miranda-ng.org/main/trunk@2449 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CSList')
-rw-r--r-- | plugins/CSList/src/cslist.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index 86100b2ee1..47abad2db2 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -91,13 +91,20 @@ static int OnInitOptions(WPARAM wparam, LPARAM lparam) odp.pszGroup = LPGEN("Status");
odp.flags = ODPF_BOLDGROUPS;
Options_AddPage(wparam, &odp);
- return FALSE;
+ return 0;
}
static int OnCreateMenuItems(WPARAM wparam, LPARAM lparam)
{
forAllProtocols(addProtoStatusMenuItem, 0);
- return FALSE;
+ return 0;
+}
+
+static int OnPreshutdown(WPARAM wparam, LPARAM lparam)
+{
+ for (int i=0; i < arWindows.getCount(); i++)
+ DestroyWindow(arWindows[i]->m_handle);
+ return 0;
}
extern "C" __declspec(dllexport) int Load()
@@ -134,7 +141,9 @@ extern "C" __declspec(dllexport) int Load() HookEvent(ME_OPT_INITIALISE, OnInitOptions);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnDbChanged);
HookEvent(ME_CLIST_PREBUILDSTATUSMENU, OnCreateMenuItems);
- return FALSE;
+ HookEvent(ME_SYSTEM_MODULESLOADED, OnCreateMenuItems);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreshutdown);
+ return 0;
}
// ====[ UNLOADER ]===========================================================
@@ -142,7 +151,7 @@ extern "C" __declspec(dllexport) int Load() extern "C" __declspec(dllexport) int Unload()
{
arWindows.destroy();
- return FALSE;
+ return 0;
}
// ====[ FUN ]================================================================
|