Add View::make_inactive() to remove context from rendering thread
View::make_inactive() is called just before termination of the rendering thread. The implementation must clear the thread's GL context. This ensures there is no context still bound to a thread during GL shutdown. This is needed as GL will not actually delete a context until it is not active on any thread. Fixes mapbox/mapbox-gl-native#340 Conflicts: common/glfw_view.hpp include/llmr/map/view.hpp test/headless.cpp
This commit is contained in:
@@ -179,6 +179,19 @@ void HeadlessView::make_active() {
|
||||
#endif
|
||||
}
|
||||
|
||||
void HeadlessView::make_inactive() {
|
||||
#if MBGL_USE_CGL
|
||||
CGLError error = CGLSetCurrentContext(nullptr);
|
||||
if (error) {
|
||||
fprintf(stderr, "Removing OpenGL context failed\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
#if MBGL_USE_GLX
|
||||
// no-op
|
||||
#endif
|
||||
}
|
||||
|
||||
void HeadlessView::swap() {}
|
||||
|
||||
unsigned int HeadlessView::root_fbo() {
|
||||
|
||||
Reference in New Issue
Block a user