[android] Refcount the view activations

Fixes #5836
Fixes #5721
This commit is contained in:
Thiago Marcos P. Santos
2016-08-05 16:21:30 +03:00
committed by Ivo van Dongen
parent 016157c39e
commit 0c460a5590
2 changed files with 10 additions and 0 deletions

View File

@@ -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);