[macos,ios] initialize util::RunLoop in SDK rather than by default

This commit is contained in:
Konstantin Käfer
2016-10-06 16:10:09 +02:00
committed by John Firebaugh
parent 7bcb04a609
commit 08809b4d44
5 changed files with 21 additions and 1 deletions

View File

@@ -8,7 +8,6 @@ namespace mbgl {
namespace util {
static ThreadLocal<RunLoop>& current = *new ThreadLocal<RunLoop>;
static RunLoop mainRunLoop;
class RunLoop::Impl {
public:
@@ -22,6 +21,7 @@ RunLoop* RunLoop::Get() {
RunLoop::RunLoop(Type)
: impl(std::make_unique<Impl>()) {
assert(!current.get());
current.set(this);
impl->async = std::make_unique<AsyncTask>(std::bind(&RunLoop::process, this));
}