From 42146ea0704e4fec994431cf4cf53983e806ced1 Mon Sep 17 00:00:00 2001 From: binary1248 Date: Sat, 20 Aug 2016 14:20:15 +0200 Subject: [PATCH] Fixed leak of XVisualInfo objects during GlxContext creation. --- src/SFML/Window/Unix/GlxContext.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/SFML/Window/Unix/GlxContext.cpp b/src/SFML/Window/Unix/GlxContext.cpp index 7251db2be..4d4d83127 100644 --- a/src/SFML/Window/Unix/GlxContext.cpp +++ b/src/SFML/Window/Unix/GlxContext.cpp @@ -482,8 +482,11 @@ void GlxContext::createSurface(GlxContext* shared, unsigned int width, unsigned if (visual->visualid == visualInfo.visualid) { config = &configs[i]; + XFree(visual); break; } + + XFree(visual); } if (config) @@ -640,8 +643,11 @@ void GlxContext::createContext(GlxContext* shared) if (visual->visualid == visualInfo->visualid) { config = &configs[i]; + XFree(visual); break; } + + XFree(visual); } if (!config)