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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user