user32: Move freeing of a 16-bit module's icons to user16.c.
This commit is contained in:
parent
d5b270eadd
commit
e3bcc11beb
@ -446,33 +446,6 @@ static INT CURSORICON_DelSharedIcon( HICON hIcon )
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
|
||||||
* 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
|
* get_icon_size
|
||||||
*/
|
*/
|
||||||
|
@ -303,6 +303,19 @@ static int release_shared_icon( HICON16 icon )
|
|||||||
return -1;
|
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)
|
* InitApp (USER.5)
|
||||||
@ -1516,7 +1529,7 @@ void WINAPI SignalProc16( HANDLE16 hModule, UINT16 code,
|
|||||||
{
|
{
|
||||||
/* HOOK_FreeModuleHooks( hModule ); */
|
/* HOOK_FreeModuleHooks( hModule ); */
|
||||||
CLASS_FreeModuleClasses( hModule );
|
CLASS_FreeModuleClasses( hModule );
|
||||||
CURSORICON_FreeModuleIcons( hModule );
|
free_module_icons( GetExePtr(hModule) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -326,7 +326,6 @@ typedef struct
|
|||||||
|
|
||||||
#include "poppack.h"
|
#include "poppack.h"
|
||||||
|
|
||||||
extern void CURSORICON_FreeModuleIcons( HMODULE16 hModule ) DECLSPEC_HIDDEN;
|
|
||||||
extern BOOL get_icon_size( HICON handle, SIZE *size ) 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 */
|
/* Mingw's assert() imports MessageBoxA and gets confused by user32 exporting it */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user