Fix an issue when sf::Clock is constructed in a global scope leading to crashes.
This commit is contained in:
parent
745b446440
commit
bc8a90b33a
@ -33,8 +33,6 @@
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
sf::Mutex oldWindowsMutex;
|
|
||||||
|
|
||||||
LARGE_INTEGER getFrequency()
|
LARGE_INTEGER getFrequency()
|
||||||
{
|
{
|
||||||
LARGE_INTEGER frequency;
|
LARGE_INTEGER frequency;
|
||||||
@ -67,6 +65,8 @@ Time ClockImpl::getCurrentTime()
|
|||||||
|
|
||||||
if (oldWindows)
|
if (oldWindows)
|
||||||
{
|
{
|
||||||
|
static sf::Mutex oldWindowsMutex;
|
||||||
|
|
||||||
// Acquire a lock (CRITICAL_SECTION) to prevent travelling back in time
|
// Acquire a lock (CRITICAL_SECTION) to prevent travelling back in time
|
||||||
Lock lock(oldWindowsMutex);
|
Lock lock(oldWindowsMutex);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user