summaryrefslogtreecommitdiff
path: root/platform/qt/src/thread_local.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/qt/src/thread_local.cpp')
-rw-r--r--platform/qt/src/thread_local.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/qt/src/thread_local.cpp b/platform/qt/src/thread_local.cpp
index e48a9d6e74..e835a680e2 100644
--- a/platform/qt/src/thread_local.cpp
+++ b/platform/qt/src/thread_local.cpp
@@ -4,6 +4,7 @@
#include <mbgl/map/backend_scope.hpp>
#include <array>
+#include <cassert>
#include <QThreadStorage>
@@ -23,7 +24,11 @@ ThreadLocal<T>::ThreadLocal() : impl(std::make_unique<Impl>()) {
template <class T>
ThreadLocal<T>::~ThreadLocal() {
- delete get();
+ // ThreadLocal will not take ownership
+ // of the pointer it is managing. The pointer
+ // needs to be explicitly cleared before we
+ // destroy this object.
+ assert(!get());
}
template <class T>