From bbce51b07660e652f7f5ebd9ce8ceb1bba6e6389 Mon Sep 17 00:00:00 2001 From: Szymon Tokarz Date: Fri, 13 Dec 2013 21:49:52 +0000 Subject: 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 --- plugins/SimpleStatusMsg/src/msgbox.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'plugins/SimpleStatusMsg/src/msgbox.cpp') 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); } } -- cgit v1.2.3