Use std::shared_ptr instead of std::unique_ptr for Platform::TimerRef.

We currently support MSVC 2013, and MSVC 2013 has weird bugs around
std::unique_ptr; the one we hit is Connect ID 858243. You can't
actually open the bug report anymore because Microsoft has shut down
Microsoft Connect. We probably shouldn't support a compiler so old
its bugtracker doesn't exist anymore, but there isn't any very good
reason to use unique_ptr for TimerRef either, so let's change that
for the time being.
pull/339/head
whitequark 2018-07-18 23:49:51 +00:00
parent a738e3f82e
commit 4f52167a78
5 changed files with 5 additions and 5 deletions

View File

@ -140,7 +140,7 @@ public:
virtual void RunAfterProcessingEvents() { RunAfter(0); } virtual void RunAfterProcessingEvents() { RunAfter(0); }
}; };
typedef std::unique_ptr<Timer> TimerRef; typedef std::shared_ptr<Timer> TimerRef;
TimerRef CreateTimer(); TimerRef CreateTimer();

View File

@ -218,7 +218,7 @@ public:
}; };
TimerRef CreateTimer() { TimerRef CreateTimer() {
return std::unique_ptr<TimerImplGtk>(new TimerImplGtk); return std::make_shared<TimerImplGtk>();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -187,7 +187,7 @@ public:
}; };
TimerRef CreateTimer() { TimerRef CreateTimer() {
return std::unique_ptr<TimerImplCocoa>(new TimerImplCocoa); return std::make_shared<TimerImplCocoa>();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -89,7 +89,7 @@ public:
}; };
TimerRef CreateTimer() { TimerRef CreateTimer() {
return std::unique_ptr<Timer>(new TimerImplDummy); return std::make_shared<TimerImplDummy>();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@ -258,7 +258,7 @@ public:
}; };
TimerRef CreateTimer() { TimerRef CreateTimer() {
return std::unique_ptr<TimerImplWin32>(new TimerImplWin32); return std::make_shared<TimerImplWin32>();
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------