[PATCH 3/4] explorerframe: Release the returned imagelist.

Huw Davies huw at codeweavers.com
Tue Apr 25 03:04:58 CDT 2017


Signed-off-by: Huw Davies <huw at codeweavers.com>
---
 dlls/explorerframe/nstc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dlls/explorerframe/nstc.c b/dlls/explorerframe/nstc.c
index a2ab974058..15d2f2629b 100644
--- a/dlls/explorerframe/nstc.c
+++ b/dlls/explorerframe/nstc.c
@@ -28,6 +28,8 @@
 #include "winbase.h"
 #include "winuser.h"
 #include "shellapi.h"
+#include "commctrl.h"
+#include "commoncontrols.h"
 
 #include "wine/list.h"
 #include "wine/debug.h"
@@ -318,7 +320,10 @@ static int get_icon(LPCITEMIDLIST lpi, UINT extra_flags)
 {
     SHFILEINFOW sfi;
     UINT flags = SHGFI_PIDL | SHGFI_SYSICONINDEX | SHGFI_SMALLICON;
-    SHGetFileInfoW((LPCWSTR)lpi, 0 ,&sfi, sizeof(SHFILEINFOW), flags | extra_flags);
+    IImageList *list;
+
+    list = (IImageList *)SHGetFileInfoW((LPCWSTR)lpi, 0 ,&sfi, sizeof(SHFILEINFOW), flags | extra_flags);
+    if (list) IImageList_Release(list);
     return sfi.iIcon;
 }
 
-- 
2.12.0




More information about the wine-patches mailing list