From a554b8658f375553754e34110d066cb1b2abb87f Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Sun, 9 Feb 2025 11:23:05 +0900 Subject: [PATCH] release auto complete on MMainWnd dtor --- src/RisohEditor.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/RisohEditor.cpp b/src/RisohEditor.cpp index a50dc4b8..82975929 100644 --- a/src/RisohEditor.cpp +++ b/src/RisohEditor.cpp @@ -2238,7 +2238,7 @@ class MMainWnd : public MWindowBase // auto completion MLangAutoCompleteEdit m_auto_comp_edit; - MLangAutoComplete * m_pAutoComplete; + std::shared_ptr m_pAutoComplete; public: MDropdownArrow m_arrow; // the language drop-down arrow @@ -10368,9 +10368,6 @@ void MMainWnd::OnClose(HWND hwnd) // WM_DESTROY: the main window has been destroyed void MMainWnd::OnDestroy(HWND hwnd) { - // release auto complete - DoLangEditAutoCompleteRelease(hwnd); - // close preview HidePreview(); @@ -12166,7 +12163,6 @@ void MMainWnd::DoLangEditAutoCompleteRelease(HWND hwnd) if (m_pAutoComplete) { m_pAutoComplete->unbind(); - m_pAutoComplete->Release(); m_pAutoComplete = NULL; } @@ -12177,7 +12173,7 @@ void MMainWnd::DoLangEditAutoComplete(HWND hwnd, HWND hwndEdit) { DoLangEditAutoCompleteRelease(hwnd); - m_pAutoComplete = new MLangAutoComplete(); + m_pAutoComplete = std::make_shared(); if (!m_pAutoComplete) return;