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.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user