diff --git a/Source/Engine/Platform/Windows/WindowsPlatform.cpp b/Source/Engine/Platform/Windows/WindowsPlatform.cpp index 8860ab912..a0972d867 100644 --- a/Source/Engine/Platform/Windows/WindowsPlatform.cpp +++ b/Source/Engine/Platform/Windows/WindowsPlatform.cpp @@ -20,7 +20,6 @@ #include "../Win32/IncludeWindowsHeaders.h" #include #include -#include #include #include #include @@ -596,7 +595,7 @@ bool WindowsPlatform::Init() { if (Win32Platform::Init()) return true; - + // Init console output (engine is linked with /SUBSYSTEM:WINDOWS so it lacks of proper console output on Windows) if (CommandLine::Options.Std) { @@ -632,10 +631,11 @@ bool WindowsPlatform::Init() { typedef LONG (WIN_API_CALLCONV *NtSetTimerResolution)(ULONG DesiredResolution, unsigned char SetResolution, ULONG* CurrentResolution); const NtSetTimerResolution ntSetTimerResolution = (NtSetTimerResolution)GetProcAddress(ntdll, "NtSetTimerResolution"); - - ULONG currentResolution; - ntSetTimerResolution(1, TRUE, ¤tResolution); - + if (ntSetTimerResolution) + { + ULONG currentResolution; + ntSetTimerResolution(1, TRUE, ¤tResolution); + } ::FreeLibrary(ntdll); }