Browse Source

Platform: fix WindowlessGlxApplication context creation and destruction.

The variable wasn't initialized so it exited with assertion failure,
moreover the context wasn't deleted on destruction, causing memory leak.
pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
2a6c52c97b
  1. 6
      src/Platform/WindowlessGlxApplication.cpp

6
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);
}

Loading…
Cancel
Save