summaryrefslogtreecommitdiff
path: root/include/mbgl/map/backend.hpp
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-07-13 15:35:02 +0300
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-07-19 17:34:07 +0200
commit733661948c004dad70e634aa9f2b41402e460a6e (patch)
tree0f4cc6e0ad280eafff1fc757b419ce49b28ce6b2 /include/mbgl/map/backend.hpp
parent2d147470a5f982afb0c1a63ff632497f85ea85bf (diff)
downloadqtlocation-mapboxgl-733661948c004dad70e634aa9f2b41402e460a6e.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.hpp')
-rw-r--r--include/mbgl/map/backend.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/mbgl/map/backend.hpp b/include/mbgl/map/backend.hpp
index 884c4b5256..69a998709b 100644
--- a/include/mbgl/map/backend.hpp
+++ b/include/mbgl/map/backend.hpp
@@ -3,6 +3,7 @@
#include <mbgl/map/map_observer.hpp>
#include <mbgl/util/image.hpp>
#include <mbgl/util/size.hpp>
+#include <mbgl/util/util.hpp>
#include <memory>
#include <mutex>
@@ -80,4 +81,8 @@ private:
friend class BackendScope;
};
+constexpr bool operator==(const Backend& a, const Backend& b) {
+ return &a == &b;
+}
+
} // namespace mbgl