diff --git a/src/Platform/WindowlessGlxApplication.cpp b/src/Platform/WindowlessGlxApplication.cpp index 2d7c017b8..0108bc2ca 100644 --- a/src/Platform/WindowlessGlxApplication.cpp +++ b/src/Platform/WindowlessGlxApplication.cpp @@ -33,11 +33,11 @@ namespace Magnum { namespace Platform { -WindowlessGlxApplication::WindowlessGlxApplication(const Arguments&) { +WindowlessGlxApplication::WindowlessGlxApplication(const Arguments&): c(nullptr) { createContext(new Configuration); } -WindowlessGlxApplication::WindowlessGlxApplication(const Arguments&, Configuration* configuration) { +WindowlessGlxApplication::WindowlessGlxApplication(const Arguments&, Configuration* configuration): c(nullptr) { if(configuration) createContext(configuration); } @@ -104,6 +104,8 @@ void WindowlessGlxApplication::createContext(Configuration* configuration) { } WindowlessGlxApplication::~WindowlessGlxApplication() { + delete c; + glXMakeCurrent(display, None, nullptr); glXDestroyContext(display, context); }