https://git.reactos.org/?p=reactos.git;a=commitdiff;h=888540c2d3df1ee65adaa20dc5a8c04f12444689

commit 888540c2d3df1ee65adaa20dc5a8c04f12444689
Author:     Timo Kreuzer <timo.kreu...@reactos.org>
AuthorDate: Wed Jan 15 17:02:41 2025 +0200
Commit:     Timo Kreuzer <timo.kreu...@reactos.org>
CommitDate: Sun Jan 19 09:02:58 2025 +0200

    [BROWSEUI] Check if ATL windows are valid, before destroying them
    
    Prevents ATL assertion failure.
---
 dll/win32/browseui/CAutoComplete.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dll/win32/browseui/CAutoComplete.cpp 
b/dll/win32/browseui/CAutoComplete.cpp
index e05c31b8b76..075654109b8 100644
--- a/dll/win32/browseui/CAutoComplete.cpp
+++ b/dll/win32/browseui/CAutoComplete.cpp
@@ -1584,9 +1584,9 @@ LRESULT CAutoComplete::OnNCDestroy(UINT uMsg, WPARAM 
wParam, LPARAM lParam, BOOL
     m_hwndSizeBox.m_pDropDown = NULL;
 
     // destroy controls
-    m_hwndList.DestroyWindow();
-    m_hwndScrollBar.DestroyWindow();
-    m_hwndSizeBox.DestroyWindow();
+    if (m_hwndList) m_hwndList.DestroyWindow();
+    if (m_hwndScrollBar) m_hwndScrollBar.DestroyWindow();
+    if (m_hwndSizeBox) m_hwndSizeBox.DestroyWindow();
 
     // clean up
     m_hwndCombo = NULL;

Reply via email to