From f3f2ed15363428b54853916fd91716da29f0fcbe Mon Sep 17 00:00:00 2001 From: degasus Date: Sun, 8 Mar 2015 17:42:37 +0100 Subject: [PATCH] GLX: fix memory leak --- Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp | 4 +++- Source/Core/VideoBackends/OGL/GLInterface/GLX.h | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp b/Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp index e9549998f8..8fb6da5639 100644 --- a/Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp +++ b/Source/Core/VideoBackends/OGL/GLInterface/GLX.cpp @@ -92,7 +92,7 @@ bool cInterfaceGLX::Create(void *window_handle) XFree(fbc); // Get an appropriate visual - vi = glXGetVisualFromFBConfig(dpy, fbconfig); + XVisualInfo* vi = glXGetVisualFromFBConfig(dpy, fbconfig); // Create a GLX context. // We try to get a 3.3 core profile, else we try it with anything we get. @@ -142,6 +142,8 @@ bool cInterfaceGLX::Create(void *window_handle) s_backbuffer_height = attribs.height; win = XWindow.CreateXWindow(parent, vi); + XFree(vi); + return true; } diff --git a/Source/Core/VideoBackends/OGL/GLInterface/GLX.h b/Source/Core/VideoBackends/OGL/GLInterface/GLX.h index 8198ea9194..7b6f8ac8f0 100644 --- a/Source/Core/VideoBackends/OGL/GLInterface/GLX.h +++ b/Source/Core/VideoBackends/OGL/GLInterface/GLX.h @@ -17,7 +17,6 @@ private: Display *dpy; Window win; GLXContext ctx; - XVisualInfo *vi; GLXFBConfig fbconfig; public: friend class cX11Window;