summaryrefslogtreecommitdiff
path: root/platform/android/src/run_loop_impl.hpp
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2016-03-10 14:03:04 -0300
committerThiago Marcos P. Santos <thiago@mapbox.com>2016-04-06 04:52:51 -0300
commit10b503eabfb3c0c53b9a4bef8849f2511ae0ac16 (patch)
tree5b46f173fb4b6b021f5c4ff00b0c91eec8285c41 /platform/android/src/run_loop_impl.hpp
parent74a1d3c1641673409a7058869249cf260870b9c0 (diff)
downloadqtlocation-mapboxgl-10b503eabfb3c0c53b9a4bef8849f2511ae0ac16.tar.gz
[android] Attach thread on the RunLoop
Needed because Looper could be used by Java and it would crash complaining that we didn't detach otherwise.
Diffstat (limited to 'platform/android/src/run_loop_impl.hpp')
-rw-r--r--platform/android/src/run_loop_impl.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/android/src/run_loop_impl.hpp b/platform/android/src/run_loop_impl.hpp
index a96ea1a1c9..2dd912994f 100644
--- a/platform/android/src/run_loop_impl.hpp
+++ b/platform/android/src/run_loop_impl.hpp
@@ -1,5 +1,7 @@
#pragma once
+#include "jni.hpp"
+
#include <mbgl/util/chrono.hpp>
#include <mbgl/util/run_loop.hpp>
@@ -34,6 +36,9 @@ public:
private:
friend RunLoop;
+ JNIEnv *env = nullptr;
+ bool detach = false;
+
ALooper* loop = nullptr;
std::atomic<bool> running;