summaryrefslogtreecommitdiff
path: root/include/mbgl/map/backend_scope.hpp
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-07-13 15:35:02 +0300
committerIvo van Dongen <info@ivovandongen.nl>2017-07-18 17:06:33 +0200
commit386556b1a4be5ed4d9864fb2870c9b7a6b0da37b (patch)
tree0f4cc6e0ad280eafff1fc757b419ce49b28ce6b2 /include/mbgl/map/backend_scope.hpp
parent2d147470a5f982afb0c1a63ff632497f85ea85bf (diff)
downloadqtlocation-mapboxgl-386556b1a4be5ed4d9864fb2870c9b7a6b0da37b.tar.gz
[core] BackendScope prevent double (de-)activation
- Guards against duplicate activations by checking wether the backend of the prior scope is the same as the current ones - Makes sure that only the most outer backend scope deactivates by tracking activation state
Diffstat (limited to 'include/mbgl/map/backend_scope.hpp')
-rw-r--r--include/mbgl/map/backend_scope.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mbgl/map/backend_scope.hpp b/include/mbgl/map/backend_scope.hpp
index 4985cd197f..322c17b3fc 100644
--- a/include/mbgl/map/backend_scope.hpp
+++ b/include/mbgl/map/backend_scope.hpp
@@ -22,10 +22,14 @@ public:
static bool exists();
private:
+ void activate();
+ void deactivate();
+
BackendScope* priorScope;
BackendScope* nextScope;
Backend& backend;
const ScopeType scopeType;
+ bool activated = false;
};
} // namespace mbgl