From 71549e7b93b6b44ed38e8915d8735c136889c3f1 Mon Sep 17 00:00:00 2001 From: Leith Bade Date: Tue, 24 Jun 2014 00:41:28 +1000 Subject: 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 --- common/glfw_view.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'common') 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); -- cgit v1.2.1