Commit e3bcc11b authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Move freeing of a 16-bit module's icons to user16.c.

parent d5b270ea
......@@ -447,33 +447,6 @@ static INT CURSORICON_DelSharedIcon( HICON hIcon )
}
/**********************************************************************
* CURSORICON_FreeModuleIcons
*/
void CURSORICON_FreeModuleIcons( HMODULE16 hMod16 )
{
ICONCACHE **ptr = &IconAnchor;
HMODULE hModule = HMODULE_32(GetExePtr( hMod16 ));
EnterCriticalSection( &IconCrst );
while ( *ptr )
{
if ( (*ptr)->hModule == hModule )
{
ICONCACHE *freePtr = *ptr;
*ptr = freePtr->next;
GlobalFree16(HICON_16(freePtr->hIcon));
HeapFree( GetProcessHeap(), 0, freePtr );
continue;
}
ptr = &(*ptr)->next;
}
LeaveCriticalSection( &IconCrst );
}
/**********************************************************************
* get_icon_size
*/
BOOL get_icon_size( HICON handle, SIZE *size )
......
......@@ -303,6 +303,19 @@ static int release_shared_icon( HICON16 icon )
return -1;
}
static void free_module_icons( HINSTANCE16 inst )
{
struct cache_entry *cache, *next;
LIST_FOR_EACH_ENTRY_SAFE( cache, next, &icon_cache, struct cache_entry, entry )
{
if (cache->inst != inst) continue;
list_remove( &cache->entry );
GlobalFree16( cache->icon );
HeapFree( GetProcessHeap(), 0, cache );
}
}
/**********************************************************************
* InitApp (USER.5)
......@@ -1516,7 +1529,7 @@ void WINAPI SignalProc16( HANDLE16 hModule, UINT16 code,
{
/* HOOK_FreeModuleHooks( hModule ); */
CLASS_FreeModuleClasses( hModule );
CURSORICON_FreeModuleIcons( hModule );
free_module_icons( GetExePtr(hModule) );
}
}
......
......@@ -326,7 +326,6 @@ typedef struct
#include "poppack.h"
extern void CURSORICON_FreeModuleIcons( HMODULE16 hModule ) DECLSPEC_HIDDEN;
extern BOOL get_icon_size( HICON handle, SIZE *size ) DECLSPEC_HIDDEN;
/* Mingw's assert() imports MessageBoxA and gets confused by user32 exporting it */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment