summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorLeith Bade <leith@leithalweapon.geek.nz>2014-06-24 00:41:28 +1000
committerMike Morris <michael.patrick.morris@gmail.com>2014-09-10 18:31:20 -0400
commit71549e7b93b6b44ed38e8915d8735c136889c3f1 (patch)
tree41713e8771be946304e9f04cf4477b34e17cd6e8 /common
parentc004c036964e9012b08aa4a2f8b16094630d62be (diff)
downloadqtlocation-mapboxgl-71549e7b93b6b44ed38e8915d8735c136889c3f1.tar.gz
Adds the function Map::terminate() to allow all GL resources held
by the map to be released immediately. Map::terminate() will call any GL functions on the current thread without blocking or defering to the rendering thread. This function allows a GL context to be destroyed and recreated safely without having to delete the Map object. Fixes mapbox/mapbox-gl-native#341 Conflicts: include/llmr/renderer/painter.hpp test/headless.cpp
Diffstat (limited to 'common')
-rw-r--r--common/glfw_view.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/glfw_view.cpp b/common/glfw_view.cpp
index 724b8bf180..0908786bb6 100644
--- a/common/glfw_view.cpp
+++ b/common/glfw_view.cpp
@@ -8,7 +8,10 @@ GLFWView::GLFWView(bool fullscreen) : fullscreen(fullscreen) {
#endif
}
-GLFWView::~GLFWView() { glfwTerminate(); }
+GLFWView::~GLFWView() {
+ map->terminate();
+ glfwTerminate();
+}
void GLFWView::initialize(mbgl::Map *map) {
View::initialize(map);