From afce26260180a442aea9dd9308140d9ea0318104 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 30 Apr 2010 10:52:24 +0000 Subject: [PATCH] Added free of _visualInfo if it's already been allocated --- src/osgViewer/GraphicsWindowX11.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/osgViewer/GraphicsWindowX11.cpp b/src/osgViewer/GraphicsWindowX11.cpp index 31d442411..f00d465ea 100644 --- a/src/osgViewer/GraphicsWindowX11.cpp +++ b/src/osgViewer/GraphicsWindowX11.cpp @@ -282,6 +282,16 @@ Display* GraphicsWindowX11::getDisplayToUse() const bool GraphicsWindowX11::createVisualInfo() { + if (_visualInfo) + { + #ifdef OSG_USE_EGL + delete _visualInfo; + #else + XFree(_visualInfo); + #endif + _visualInfo = 0; + } + if( _window != 0 ) { XWindowAttributes watt;