From 3169524864cab5178cf1106222e64170c866f16d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 18 Nov 2018 23:10:07 +0100 Subject: [PATCH] Don't destroy the HICON returned by SHDefExtractIcon() twice Surprisingly, this doesn't seem to result in any ill effects, but passing HICON to wxIcon already ensures that this HICON will be destroyed in wxIcon dtor, so we shouldn't call ::DestroyIcon() on it manually. --- src/msw/artmsw.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/msw/artmsw.cpp b/src/msw/artmsw.cpp index 2fea3339e9..0d49683846 100644 --- a/src/msw/artmsw.cpp +++ b/src/msw/artmsw.cpp @@ -101,10 +101,7 @@ MSWGetBitmapFromIconLocation(const TCHAR* path, int index, const wxSize& size) if ( !icon.InitFromHICON((WXHICON)hIcon, size.x, size.x) ) return wxNullBitmap; - wxBitmap bitmap(icon); - ::DestroyIcon(hIcon); - - return bitmap; + return wxBitmap(icon); } wxBitmap