summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/vertex_array.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/gl/vertex_array.hpp')
-rw-r--r--src/mbgl/gl/vertex_array.hpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mbgl/gl/vertex_array.hpp b/src/mbgl/gl/vertex_array.hpp
index 9ccf48d9bd..46c67017bb 100644
--- a/src/mbgl/gl/vertex_array.hpp
+++ b/src/mbgl/gl/vertex_array.hpp
@@ -40,7 +40,22 @@ private:
}
};
-using UniqueVertexArrayState = std::unique_ptr<VertexArrayState, std::function<void (VertexArrayState*)>>;
+class VertexArrayStateDeleter {
+public:
+ VertexArrayStateDeleter(bool destroy_)
+ : destroy(destroy_) {}
+
+ void operator()(VertexArrayState* ptr) const {
+ if (destroy) {
+ delete ptr;
+ }
+ }
+
+private:
+ bool destroy;
+};
+
+using UniqueVertexArrayState = std::unique_ptr<VertexArrayState, VertexArrayStateDeleter>;
class VertexArray {
public: