summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2016-08-05 15:12:28 -0400
committerIvo van Dongen <info@ivovandongen.nl>2016-08-05 15:12:28 -0400
commitd043f7374c82136fdfeae3a443c4627430002f53 (patch)
tree91fda98d20093f692262d3a713544071dc4b2ff1
parentdb15ff78e66f357619ae82494f6d89d93502ff72 (diff)
downloadqtlocation-mapboxgl-d043f7374c82136fdfeae3a443c4627430002f53.tar.gz
[android] - merge fixes from 5874
-rwxr-xr-xplatform/android/src/native_map_view.cpp8
-rwxr-xr-xplatform/android/src/native_map_view.hpp2
2 files changed, 10 insertions, 0 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp
index 578e5d0033..385accfa9d 100755
--- a/platform/android/src/native_map_view.cpp
+++ b/platform/android/src/native_map_view.cpp
@@ -125,6 +125,10 @@ std::array<uint16_t, 2> NativeMapView::getFramebufferSize() const {
}
void NativeMapView::activate() {
+ if (active++) {
+ return;
+ }
+
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::activate");
oldDisplay = eglGetCurrentDisplay();
@@ -151,6 +155,10 @@ void NativeMapView::activate() {
}
void NativeMapView::deactivate() {
+ if (--active) {
+ return;
+ }
+
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::deactivate");
assert(vm != nullptr);
diff --git a/platform/android/src/native_map_view.hpp b/platform/android/src/native_map_view.hpp
index 9b5af76dfe..7974f282d9 100755
--- a/platform/android/src/native_map_view.hpp
+++ b/platform/android/src/native_map_view.hpp
@@ -97,6 +97,8 @@ private:
std::unique_ptr<mbgl::DefaultFileSource> fileSource;
std::unique_ptr<mbgl::Map> map;
mbgl::EdgeInsets insets;
+
+ unsigned active = 0;
};
}
}