diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-22 12:37:37 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-22 12:37:37 +0000 |
commit | d37289b1e279731fed35dea7752412bbd99abe61 (patch) | |
tree | 9f80e0f87514df344875fd5bb4cada09e5c125b0 /plugins | |
parent | 5095e9d08fedfb4ea175403266b343f4561a1a9d (diff) |
git-svn-id: http://svn.miranda-ng.org/main/trunk@526 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/TopToolBar/toolbar.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/plugins/TopToolBar/toolbar.cpp b/plugins/TopToolBar/toolbar.cpp index bb29e41ed5..b890c1f67d 100644 --- a/plugins/TopToolBar/toolbar.cpp +++ b/plugins/TopToolBar/toolbar.cpp @@ -191,6 +191,7 @@ INT_PTR TTBRemoveButton(WPARAM wParam, LPARAM lParam) }
Buttons.remove(b);
+ delete b;
ArrangeButtons();
ulockbut();
@@ -265,8 +266,9 @@ INT_PTR TTBAddButton(WPARAM wParam, LPARAM lParam) return -1;
}
- TopButtonInt* b = new TopButtonInt; // due to OBJLIST
+ TopButtonInt* b = new TopButtonInt;
b->id = nextButtonId++;
+ b->tooltip = NULL;
if (but->dwFlags & TTBBF_ISLBUTTON) {
if (but->program != NULL)
@@ -905,19 +907,8 @@ int UnloadToolbarModule() arServices.destroy();
arHooks.destroy();
- for (int i=0; i < Buttons.getCount(); i++) {
- if (Buttons[i]->dwFlags & TTBBF_ISLBUTTON) {
- if (Buttons[i]->program != NULL)
- free(Buttons[i]->program);
- }
- else if (Buttons[i]->pszService != NULL)
- free(Buttons[i]->pszService);
-
- if (Buttons[i]->name != NULL)
- free(Buttons[i]->name);
- if (Buttons[i]->tooltip != NULL)
- free(Buttons[i]->tooltip);
- }
+ for (int i=0; i < Buttons.getCount(); i++)
+ delete Buttons[i];
Buttons.destroy();
return 0;
}
|