mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 17:36:25 +00:00
use GetModuleHandleW() to retrieve kernel32.dll handle (bug #5390.)
SDL_systhread.c and SDL_syslocale.c used to call LoadLibrary() without calling FreeLibrary() later. GetModuleHandleW() should always succeed because GetModuleHandleW() itself is imported from kernel32.dll and we don't need to bother releasing it.
This commit is contained in:
@@ -163,7 +163,7 @@ SDL_SYS_SetupThread(const char *name)
|
||||
static HMODULE kernel32 = 0;
|
||||
|
||||
if (!kernel32) {
|
||||
kernel32 = LoadLibraryW(L"kernel32.dll");
|
||||
kernel32 = GetModuleHandleW(L"kernel32.dll");
|
||||
if (kernel32) {
|
||||
pSetThreadDescription = (pfnSetThreadDescription) GetProcAddress(kernel32, "SetThreadDescription");
|
||||
}
|
||||
|
Reference in New Issue
Block a user