diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-11 07:08:40 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-11 07:08:40 +0000 |
commit | bd820972afe24409e6b570adbc45f5dc0fa2385d (patch) | |
tree | e600bf39409083219c7928e10ec2b61002529641 /src/modules | |
parent | 6029165c364f93a84ab7e98ef71d3a711b0f588c (diff) |
SRMM icons to be unloaded automatically
git-svn-id: http://svn.miranda-ng.org/main/trunk@4418 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/plugins/newplugins.cpp | 1 | ||||
-rw-r--r-- | src/modules/srmm/statusicon.cpp | 14 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp index 90ea348e59..dccf3fe780 100644 --- a/src/modules/plugins/newplugins.cpp +++ b/src/modules/plugins/newplugins.cpp @@ -366,6 +366,7 @@ int Plugin_UnloadDyn(pluginEntry *p) KillModuleHotkeys(hLangpack);
KillModuleSounds(hLangpack);
KillModuleExtraIcons(hLangpack);
+ KillModuleSrmmIcons(hLangpack);
}
NotifyEventHooks(hevUnloadModule, (WPARAM)p->bpi.pluginInfo, (LPARAM)p->bpi.hInst);
diff --git a/src/modules/srmm/statusicon.cpp b/src/modules/srmm/statusicon.cpp index dcf055a88f..ca5f526fac 100644 --- a/src/modules/srmm/statusicon.cpp +++ b/src/modules/srmm/statusicon.cpp @@ -49,6 +49,8 @@ struct StatusIconMain : public MZeroedObject }
StatusIconData sid;
+
+ int hPangpack;
OBJLIST<StatusIconChild> arChildren;
};
@@ -111,6 +113,7 @@ static INT_PTR AddStatusIcon(WPARAM wParam, LPARAM lParam) p = new StatusIconMain;
memcpy(&p->sid, sid, sizeof(p->sid));
+ p->hPangpack = (int)wParam;
p->sid.szModule = mir_strdup(sid->szModule);
p->sid.szTooltip = mir_strdup(sid->szTooltip);
arIcons.insert(p);
@@ -185,9 +188,18 @@ static int OnModulesLoaded(WPARAM, LPARAM) return 0;
}
+void KillModuleSrmmIcons(int hLangpack)
+{
+ for (int i=arIcons.getCount()-1; i >= 0; i--) {
+ StatusIconMain &p = arIcons[i];
+ if (p.hPangpack == hLangpack)
+ arIcons.remove(i);
+ }
+}
+
int LoadSrmmModule()
{
- CreateServiceFunction(MS_MSG_ADDICON, AddStatusIcon);
+ CreateServiceFunction("MessageAPI/AddIcon", AddStatusIcon);
CreateServiceFunction(MS_MSG_REMOVEICON, RemoveStatusIcon);
CreateServiceFunction(MS_MSG_MODIFYICON, ModifyStatusIcon);
CreateServiceFunction(MS_MSG_GETNTHICON, GetNthIcon);
|