summaryrefslogtreecommitdiff
path: root/plugins/SimpleStatusMsg/src/msgbox.cpp
diff options
context:
space:
mode:
authorSzymon Tokarz <wsx22@o2.pl>2013-12-13 21:49:52 +0000
committerSzymon Tokarz <wsx22@o2.pl>2013-12-13 21:49:52 +0000
commitbbce51b07660e652f7f5ebd9ce8ceb1bba6e6389 (patch)
tree9148a1e6663c97bcf1283f0b443ceef17d47c47f /plugins/SimpleStatusMsg/src/msgbox.cpp
parent2c73c95d00f1637031042a75fc99d2a4ba92d21b (diff)
Simple Status Message
- fix some memory related issues. (Schould fix ticket #510) git-svn-id: http://svn.miranda-ng.org/main/trunk@7196 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SimpleStatusMsg/src/msgbox.cpp')
-rw-r--r--plugins/SimpleStatusMsg/src/msgbox.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp
index ad4e67970f..0bfa7111c5 100644
--- a/plugins/SimpleStatusMsg/src/msgbox.cpp
+++ b/plugins/SimpleStatusMsg/src/msgbox.cpp
@@ -781,9 +781,9 @@ void SetEditControlText(struct MsgBoxData *data, HWND hwndDlg, int iStatus)
if (!db_get(NULL, "SimpleStatusMsg", setting, &dbv))
{
- if (dbv.pszVal)
+ if (dbv.pszVal && strlen(dbv.pszVal))
{
- if (strlen(dbv.pszVal) && !db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2))
+ if (!db_get_ts(NULL, "SimpleStatusMsg", dbv.pszVal, &dbv2))
{
if (dbv2.ptszVal && lstrlen(dbv2.ptszVal))
{
@@ -1154,8 +1154,6 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
if (bCurrentStatus)
copy_init_data->m_iStatus = ID_STATUS_CURRENT;
- mir_free(init_data);
-
mir_subclassWindow( GetDlgItem(hwndDlg, IDC_EDIT1), EditBoxSubProc);
if (!init_data->m_bOnEvent && IsWindowEnabled(GetDlgItem(hwndDlg, IDC_EDIT1)))
{
@@ -1165,6 +1163,8 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
else
SetFocus(GetDlgItem(hwndDlg, IDC_OK));
+ mir_free(init_data);
+
if (!db_get_b(NULL, "SimpleStatusMsg", "WinCentered", 1))
{
WINDOWPLACEMENT wp;
@@ -1323,6 +1323,7 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
db_free(&dbv);
break;
}
+ db_free(&dbv);
}
}