[PATCH 1/2] user32: Release the icon frame in CopyImage.

Stefan Dösinger stefan at codeweavers.com
Thu Jun 10 09:12:19 CDT 2021


Signed-off-by: Stefan Dösinger <stefan at codeweavers.com>

---

I first though this would fix the handle leak fixed in 2/2. Not sure if it does
anything, but other code that calls get_icon_frame does the same.
---
 dlls/user32/cursoricon.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c
index a225303f80f..f820c10a0d8 100644
--- a/dlls/user32/cursoricon.c
+++ b/dlls/user32/cursoricon.c
@@ -3000,6 +3000,7 @@ HANDLE WINAPI CopyImage( HANDLE hnd, UINT type, INT desiredx,
                 {
                     if (!(info.hbmColor = create_color_bitmap( desiredx, desiredy )))
                     {
+                        release_icon_frame( icon, frame );
                         release_user_handle_ptr( icon );
                         return 0;
                     }
@@ -3009,6 +3010,7 @@ HANDLE WINAPI CopyImage( HANDLE hnd, UINT type, INT desiredx,
                     if (!(info.hbmMask = CreateBitmap( desiredx, desiredy, 1, 1, NULL )))
                     {
                         DeleteObject( info.hbmColor );
+                        release_icon_frame( icon, frame );
                         release_user_handle_ptr( icon );
                         return 0;
                     }
@@ -3034,6 +3036,7 @@ HANDLE WINAPI CopyImage( HANDLE hnd, UINT type, INT desiredx,
                 DeleteObject( info.hbmMask );
             }
 
+            release_icon_frame( icon, frame );
             release_user_handle_ptr( icon );
 
             if (res && (flags & LR_COPYDELETEORG)) DeleteObject( hnd );
-- 
2.31.1




More information about the wine-devel mailing list