diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c index 832d4c8f7..3fde465b6 100644 --- a/src/render/direct3d12/SDL_render_d3d12.c +++ b/src/render/direct3d12/SDL_render_d3d12.c @@ -757,6 +757,7 @@ D3D12_CreateDeviceResources(SDL_Renderer* renderer) /* CreateEventEx() arrived in Vista, so we need to load it with GetProcAddress for XP. */ { HMODULE kernel32 = GetModuleHandle(TEXT("kernel32.dll")); + CreateEventExFunc = NULL; if (kernel32) { CreateEventExFunc = (PFN_CREATE_EVENT_EX) GetProcAddress(kernel32, "CreateEventExW"); }