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
This commit is contained in:
Leith Bade
2014-06-24 00:41:28 +10:00
committed by Mike Morris
parent c004c03696
commit 71549e7b93
5 changed files with 34 additions and 1 deletions

View File

@@ -153,6 +153,12 @@ void Map::cleanup(uv_async_t *async) {
map->painter.cleanup();
}
void Map::terminate() {
view.make_active();
painter.terminate();
view.make_inactive();
}
void Map::render(uv_async_t *async) {
Map *map = static_cast<Map *>(async->data);