From b4c68726d9071a38f97d350439c3099bce1f673c Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 8 Jun 2000 00:39:16 +0000 Subject: [PATCH] Louis-Philippe Gagnon (of Macadamian for Corel) Search for already loaded CursorIcon was done with the wrong handle, so it was leaking icons. Fixed. --- windows/cursoricon.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/windows/cursoricon.c b/windows/cursoricon.c index 0a33e82721e..f0923ca7457 100644 --- a/windows/cursoricon.c +++ b/windows/cursoricon.c @@ -739,11 +739,6 @@ HGLOBAL CURSORICON_Load( HINSTANCE hInstance, LPCWSTR name, fCursor ? RT_GROUP_CURSORW : RT_GROUP_ICONW ))) return 0; hGroupRsrc = hRsrc; - /* If shared icon, check whether it was already loaded */ - - if ( (loadflags & LR_SHARED) - && (h = CURSORICON_FindSharedIcon( hInstance, hRsrc ) ) != 0 ) - return h; /* Find the best entry in the directory */ @@ -764,6 +759,12 @@ HGLOBAL CURSORICON_Load( HINSTANCE hInstance, LPCWSTR name, if (!(hRsrc = FindResourceW(hInstance,MAKEINTRESOURCEW(wResId), fCursor ? RT_CURSORW : RT_ICONW ))) return 0; + + /* If shared icon, check whether it was already loaded */ + if ( (loadflags & LR_SHARED) + && (h = CURSORICON_FindSharedIcon( hInstance, hRsrc ) ) != 0 ) + return h; + if (!(handle = LoadResource( hInstance, hRsrc ))) return 0; bits = (LPBYTE)LockResource( handle ); h = CURSORICON_CreateFromResource( 0, 0, bits, dwBytesInRes,