From d37289b1e279731fed35dea7752412bbd99abe61 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 22 Jun 2012 12:37:37 +0000 Subject: git-svn-id: http://svn.miranda-ng.org/main/trunk@526 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TopToolBar/toolbar.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'plugins/TopToolBar/toolbar.cpp') 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; } -- cgit v1.2.3