diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-02-15 16:36:56 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-02-16 12:48:50 -0800 |
commit | d66d145c6e90dabe442c384fe2a10aef4f0a4fbb (patch) | |
tree | 9332e0ab1e826478d52631cceab901a5e60821f5 /platform | |
parent | 5ca625ba0dccc60bc3ad83fdea74a2406b3dd447 (diff) | |
download | qtlocation-mapboxgl-d66d145c6e90dabe442c384fe2a10aef4f0a4fbb.tar.gz |
[core] Remove RunLoop::{ref,unref}
Diffstat (limited to 'platform')
-rw-r--r-- | platform/default/run_loop.cpp | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/platform/default/run_loop.cpp b/platform/default/run_loop.cpp index 27f97d65e6..76c01b80b7 100644 --- a/platform/default/run_loop.cpp +++ b/platform/default/run_loop.cpp @@ -1,4 +1,3 @@ -#include <mbgl/platform/log.hpp> #include <mbgl/util/run_loop.hpp> #include <mbgl/util/async_task.hpp> #include <mbgl/util/thread_local.hpp> @@ -73,8 +72,6 @@ public: return reinterpret_cast<uv_handle_t*>(holder); } - int refCount = 1; - uv_loop_t *loop = nullptr; uv_async_t* holder = new uv_async_t; @@ -164,28 +161,7 @@ void RunLoop::runOnce() { } void RunLoop::stop() { - invoke([&] { - unref(); - - if (impl->refCount) { - Log::Debug(mbgl::Event::General, "Blocking on pending events."); - } - }); -} - -void RunLoop::ref() { - ++impl->refCount; -} - -void RunLoop::unref() { - // Main loop already stopped. - if (impl->refCount == 0) { - return; - } - - if (!--impl->refCount) { - uv_unref(impl->holderHandle()); - } + invoke([&] { uv_unref(impl->holderHandle()); }); } void RunLoop::addWatch(int fd, Event event, std::function<void(int, Event)>&& callback) { |