summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/headless_view.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/headless_view.cpp b/common/headless_view.cpp
index ff903939b7..563fd8f245 100644
--- a/common/headless_view.cpp
+++ b/common/headless_view.cpp
@@ -148,6 +148,8 @@ void HeadlessView::clear_buffers() {
}
HeadlessView::~HeadlessView() {
+ make_inactive();
+
#if MBGL_USE_CGL
CGLDestroyContext(gl_context);
#endif
@@ -179,6 +181,8 @@ void HeadlessView::make_active() {
}
void HeadlessView::make_inactive() {
+ clear_buffers();
+
#if MBGL_USE_CGL
CGLError error = CGLSetCurrentContext(nullptr);
if (error) {