From 767dbf81eee2f4c69b25a7c264a7509c50299616 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 20 Jan 2004 02:13:06 +0000 Subject: [PATCH] fix stale g_X11Display pointer causing crashes --- stepmania/src/RageDisplay_OGL.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/stepmania/src/RageDisplay_OGL.cpp b/stepmania/src/RageDisplay_OGL.cpp index de1912fc96..2950b1c63b 100644 --- a/stepmania/src/RageDisplay_OGL.cpp +++ b/stepmania/src/RageDisplay_OGL.cpp @@ -354,20 +354,6 @@ RageDisplay_OGL::RageDisplay_OGL( VideoModeParams p, bool bAllowUnacceleratedRen throw; } -#if defined(unix) - { - SDL_SysWMinfo info; - SDL_VERSION(&info.version); - if ( SDL_GetWMInfo(&info) < 0 ) - { - LOG->Warn("SDL_GetWMInfo failed: %s", SDL_GetError()); - return; - } - g_X11Display = info.info.x11.display; - } -#endif - - // Log driver details LOG->Info("OGL Vendor: %s", glGetString(GL_VENDOR)); LOG->Info("OGL Renderer: %s", glGetString(GL_RENDERER)); @@ -680,6 +666,19 @@ CString RageDisplay_OGL::TryVideoMode( VideoModeParams p, bool &bNewDeviceOut ) TEXTUREMAN->InvalidateTextures(); } +#if defined(unix) + { + SDL_SysWMinfo info; + SDL_VERSION(&info.version); + + g_X11Display = NULL; + if ( SDL_GetWMInfo(&info) < 0 ) + LOG->Warn("SDL_GetWMInfo failed: %s", SDL_GetError()); + else + g_X11Display = info.info.x11.display; + } +#endif + this->SetDefaultRenderStates(); DumpOpenGLDebugInfo();