From 05d6c1473c320e1f6f5c489983f64085d26504f5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 15 Jan 2018 15:30:14 +0300 Subject: fix for various memory problems in SpellChecker --- plugins/SpellChecker/src/ardialog.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'plugins/SpellChecker/src/ardialog.cpp') diff --git a/plugins/SpellChecker/src/ardialog.cpp b/plugins/SpellChecker/src/ardialog.cpp index a5948d3ec7..eec0687100 100644 --- a/plugins/SpellChecker/src/ardialog.cpp +++ b/plugins/SpellChecker/src/ardialog.cpp @@ -98,9 +98,7 @@ static LRESULT CALLBACK OnlyCharsEditProc(HWND hwnd, UINT msg, WPARAM wParam, LP case WM_PASTE: wchar_t text[256]; GetWindowText(hwnd, text, _countof(text)); - - scoped_free dest = data->dict->autoReplace->filterText(text); - SetWindowText(hwnd, dest); + SetWindowText(hwnd, ptrW(data->dict->autoReplace->filterText(text))); break; } @@ -170,10 +168,9 @@ static INT_PTR CALLBACK AddReplacementDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa SendDlgItemMessage(hwndDlg, IDC_OLD, EM_LIMITTEXT, 256, 0); SendDlgItemMessage(hwndDlg, IDC_NEW, EM_LIMITTEXT, 256, 0); - if (!data->find.empty()) { - scoped_free tmp = data->dict->autoReplace->filterText(data->find.c_str()); - SetDlgItemText(hwndDlg, IDC_OLD, tmp); - } + if (!data->find.empty()) + SetDlgItemText(hwndDlg, IDC_OLD, ptrW(data->dict->autoReplace->filterText(data->find.c_str()))); + if (!data->replace.empty()) SetDlgItemText(hwndDlg, IDC_NEW, data->replace.c_str()); -- cgit v1.2.3