[PATCH resend] explorer: Fix atom leaks caused by not releasing DDE interface

Ralf Habacker ralf.habacker at freenet.de
Thu Nov 29 09:35:25 CST 2018


From 3471b1576b34f17414124dc6afc2d6aad84e81b2 Mon Sep 17 00:00:00 2001
From: Ralf Habacker <ralf.habacker at freenet.de>
Date: Tue, 27 Nov 2018 10:37:43 +0100
Subject: [PATCH resend] explorer: Fix atom leaks caused by not releasing DDE interface

Signed-off-by: Ralf Habacker <ralf.habacker at freenet.de>
---
 v1: do not duplicate variables
 programs/explorer/desktop.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c
index d802bc3465..99b80bfd1c 100644
--- a/programs/explorer/desktop.c
+++ b/programs/explorer/desktop.c
@@ -921,6 +921,8 @@ void manage_desktop( WCHAR *arg )
     WCHAR *p = arg;
     const WCHAR *name = NULL;
     BOOL enable_shell = FALSE;
+    void (WINAPI *pShellDDEInit)( BOOL ) = NULL;
+    HMODULE shell32 = 0;
 
     /* get the rest of the command line (if any) */
     while (*p && !is_whitespace(*p)) p++;
@@ -992,9 +994,6 @@ void manage_desktop( WCHAR *arg )
 
         if (graphics_driver)
         {
-            HMODULE shell32;
-            void (WINAPI *pShellDDEInit)( BOOL );
-
             if (using_root) enable_shell = FALSE;
 
             initialize_systray( graphics_driver, using_root, enable_shell );
@@ -1035,6 +1034,12 @@ void manage_desktop( WCHAR *arg )
         WINE_TRACE( "desktop message loop exiting for hwnd %p\n", hwnd );
     }
 
+    if (pShellDDEInit)
+    {
+        pShellDDEInit( FALSE );
+        FreeLibrary(shell32);
+    }
+
     ExitProcess( 0 );
 }
 
-- 
2.13.7



More information about the wine-devel mailing list