summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/headless_view.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/headless_view.cpp b/common/headless_view.cpp
index 3fb090f2b5..f790d90cec 100644
--- a/common/headless_view.cpp
+++ b/common/headless_view.cpp
@@ -151,6 +151,13 @@ HeadlessView::~HeadlessView() {
#if MBGL_USE_CGL
CGLDestroyContext(gl_context);
#endif
+
+#if MBGL_USE_GLX
+ glXMakeCurrent(x_display, None, NULL);
+ glXDestroyContext(x_display, gl_context);
+ XFree(x_info);
+ XCloseDisplay(x_display);
+#endif
}
void HeadlessView::notify_map_change(mbgl::MapChange /*change*/, mbgl::timestamp /*delay*/) {