summaryrefslogtreecommitdiff
path: root/plugins/TopToolBar/ttbopt.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-08 21:56:45 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-08 21:56:45 +0000
commit7e61d4900d9b99958f863cd2f56fc3cd4e800600 (patch)
tree2ea789738356137ee8bf0dac0634b4ce7d27c7b6 /plugins/TopToolBar/ttbopt.cpp
parent56984a95c2514df3a96849d790a3e1bc5b3de52a (diff)
memory crash fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@367 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TopToolBar/ttbopt.cpp')
-rw-r--r--plugins/TopToolBar/ttbopt.cpp34
1 files changed, 20 insertions, 14 deletions
diff --git a/plugins/TopToolBar/ttbopt.cpp b/plugins/TopToolBar/ttbopt.cpp
index 6167f3e19e..fddfbe5e84 100644
--- a/plugins/TopToolBar/ttbopt.cpp
+++ b/plugins/TopToolBar/ttbopt.cpp
@@ -84,26 +84,30 @@ void AssignBitmapsFromDir(TCHAR *dir)
wsprintf(curnameDN, _T("%s%s_DN.bmp"), dir, ChangedName);
if ( FileExists(curnameUP)) {
- if (Buttons[i].UserDefinedbmUp != NULL){free(Buttons[i].UserDefinedbmUp);}
- Buttons[i].UserDefinedbmUp = _tcsdup(curnameUP);
+ if (Buttons[i].UserDefinedbmUp != NULL)
+ mir_free(Buttons[i].UserDefinedbmUp);
+ Buttons[i].UserDefinedbmUp = mir_tstrdup(curnameUP);
}
if ( FileExists(curnameDN)) {
- if (Buttons[i].UserDefinedbmDown != NULL){free(Buttons[i].UserDefinedbmDown);}
- Buttons[i].UserDefinedbmDown = _tcsdup(curnameDN);
+ if (Buttons[i].UserDefinedbmDown != NULL)
+ mir_free(Buttons[i].UserDefinedbmDown);
+ Buttons[i].UserDefinedbmDown = mir_tstrdup(curnameDN);
}
wsprintf(curnameUP, _T("%s%s_UP.ico"), dir, ChangedName);
wsprintf(curnameDN, _T("%s%s_DN.ico"), dir, ChangedName);
if ( FileExists(curnameUP)) {
- if (Buttons[i].UserDefinedbmUp != NULL){free(Buttons[i].UserDefinedbmUp);}
- Buttons[i].UserDefinedbmUp = _tcsdup(curnameUP);
+ if (Buttons[i].UserDefinedbmUp != NULL)
+ mir_free(Buttons[i].UserDefinedbmUp);
+ Buttons[i].UserDefinedbmUp = mir_tstrdup(curnameUP);
}
if ( FileExists(curnameDN)) {
- if (Buttons[i].UserDefinedbmDown != NULL){free(Buttons[i].UserDefinedbmDown);}
- Buttons[i].UserDefinedbmDown = _tcsdup(curnameDN);
+ if (Buttons[i].UserDefinedbmDown != NULL)
+ mir_free(Buttons[i].UserDefinedbmDown);
+ Buttons[i].UserDefinedbmDown = mir_tstrdup(curnameDN);
}
}
@@ -418,8 +422,8 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
int curselect = ((ButtonOptData *)tvi.lParam)->pos;
lockbut();
- if (Buttons[curselect].UserDefinedbmUp != NULL) free(Buttons[curselect].UserDefinedbmUp);
- if (Buttons[curselect].UserDefinedbmDown != NULL) free(Buttons[curselect].UserDefinedbmDown);
+ if (Buttons[curselect].UserDefinedbmUp != NULL) mir_free(Buttons[curselect].UserDefinedbmUp);
+ if (Buttons[curselect].UserDefinedbmDown != NULL) mir_free(Buttons[curselect].UserDefinedbmDown);
Buttons[curselect].UserDefinedbmUp = NULL;
Buttons[curselect].UserDefinedbmDown = NULL;
applyuserbitmaps(curselect);
@@ -476,12 +480,14 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
if (GetOpenFileName(&ofn)) {
lockbut();
if (ctrlid == IDC_BMPUP){
- if (Buttons[curselect].UserDefinedbmUp != NULL){free(Buttons[curselect].UserDefinedbmUp);}
- Buttons[curselect].UserDefinedbmUp = _tcsdup(ofn.lpstrFile);
+ if (Buttons[curselect].UserDefinedbmUp != NULL)
+ mir_free(Buttons[curselect].UserDefinedbmUp);
+ Buttons[curselect].UserDefinedbmUp = mir_tstrdup(ofn.lpstrFile);
}
if (ctrlid == IDC_BMPDN){
- if (Buttons[curselect].UserDefinedbmDown != NULL){free(Buttons[curselect].UserDefinedbmDown);}
- Buttons[curselect].UserDefinedbmDown = _tcsdup(ofn.lpstrFile);
+ if (Buttons[curselect].UserDefinedbmDown != NULL)
+ mir_free(Buttons[curselect].UserDefinedbmDown);
+ Buttons[curselect].UserDefinedbmDown = mir_tstrdup(ofn.lpstrFile);
}
applyuserbitmaps(curselect);
SetImagesForCurrent(hwndDlg, curselect);