diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2016-08-05 15:12:28 -0400 |
---|---|---|
committer | Ivo van Dongen <info@ivovandongen.nl> | 2016-08-05 15:12:28 -0400 |
commit | d043f7374c82136fdfeae3a443c4627430002f53 (patch) | |
tree | 91fda98d20093f692262d3a713544071dc4b2ff1 | |
parent | db15ff78e66f357619ae82494f6d89d93502ff72 (diff) | |
download | qtlocation-mapboxgl-d043f7374c82136fdfeae3a443c4627430002f53.tar.gz |
[android] - merge fixes from 5874
-rwxr-xr-x | platform/android/src/native_map_view.cpp | 8 | ||||
-rwxr-xr-x | platform/android/src/native_map_view.hpp | 2 |
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; }; } } |