[PATCH] explorer: Only try to destroy the IShellWindows object if it exists

Alex Henrie alexhenrie24 at gmail.com
Sun Jan 30 20:25:07 CST 2022


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52494
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
 programs/explorer/explorer.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/programs/explorer/explorer.c b/programs/explorer/explorer.c
index cb0d63fb688..8fa732d6c1a 100644
--- a/programs/explorer/explorer.c
+++ b/programs/explorer/explorer.c
@@ -671,8 +671,11 @@ static LRESULT CALLBACK explorer_wnd_proc(HWND hwnd, UINT uMsg, WPARAM wParam, L
     switch(uMsg)
     {
     case WM_DESTROY:
-        IShellWindows_Revoke(info->sw, info->sw_cookie);
-        IShellWindows_Release(info->sw);
+        if(info->sw)
+        {
+            IShellWindows_Revoke(info->sw, info->sw_cookie);
+            IShellWindows_Release(info->sw);
+        }
 
         IExplorerBrowser_Unadvise(browser,info->advise_cookie);
         IExplorerBrowser_Destroy(browser);
-- 
2.35.1




More information about the wine-devel mailing list