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

commit a6b8d4f6f06581f2025ab7d9f1f1a32011fea09f
Author:     Mark Jansen <[email protected]>
AuthorDate: Sun Sep 11 21:28:23 2022 +0200
Commit:     Mark Jansen <[email protected]>
CommitDate: Mon Sep 12 20:00:39 2022 +0200

    [SHELL32] Don't try to remove buttons on a nonexisting window
---
 dll/win32/shell32/shellmenu/CMenuToolbars.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dll/win32/shell32/shellmenu/CMenuToolbars.cpp 
b/dll/win32/shell32/shellmenu/CMenuToolbars.cpp
index f38509d8cf2..1eee01f0344 100644
--- a/dll/win32/shell32/shellmenu/CMenuToolbars.cpp
+++ b/dll/win32/shell32/shellmenu/CMenuToolbars.cpp
@@ -294,10 +294,11 @@ CMenuToolbarBase::CMenuToolbarBase(CMenuBand *menuBand, 
BOOL usePager) :
 
 CMenuToolbarBase::~CMenuToolbarBase()
 {
-    ClearToolbar();
-
     if (m_hWnd)
+    {
+        ClearToolbar();
         DestroyWindow();
+    }
 
     if (m_pager.m_hWnd)
         m_pager.DestroyWindow();

Reply via email to