diff --git a/src/Magnum/Platform/WindowlessGlxApplication.cpp b/src/Magnum/Platform/WindowlessGlxApplication.cpp index c02b77dc4..9066ee7e5 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.cpp +++ b/src/Magnum/Platform/WindowlessGlxApplication.cpp @@ -27,6 +27,7 @@ #include "WindowlessGlxApplication.h" +#include #include #include #include @@ -100,6 +101,7 @@ WindowlessGlxContext::WindowlessGlxContext(const WindowlessGlxContext::Configura Error() << "Platform::WindowlessGlxContext: no supported framebuffer configuration found"; return; } + Containers::ScopeGuard freeConfigs{configs, XFree}; /* Create pbuffer */ constexpr static const int pbufferAttributes[] = { @@ -266,8 +268,6 @@ WindowlessGlxContext::WindowlessGlxContext(const WindowlessGlxContext::Configura static_cast(magnumContext); #endif - XFree(configs); - if(!_context) { Error e; e << "Platform::WindowlessGlxContext: cannot create context";