(232) Improved error message a bit when no suitable visual could be found
(X11 only).
+
+(233) Fixed part of bug #926883 (Video mode matching code, memory leaks,
+fullscreen), i.e. memory leak caused by not freeing the mode lines returned
+by XF86VidModeGetAllModeLines
*/
XFlush( fgDisplay.Display );
- return;
+ break;
}
}
+ XFree( displayModes );
}
# else
*/
static GLboolean fghChangeDisplayMode( GLboolean haveToTest )
{
+ GLboolean success = GL_FALSE;
#if TARGET_HOST_UNIX_X11
/*
fgState.GameModeDepth,
fgState.GameModeRefresh ) )
{
- if( haveToTest )
- return GL_TRUE;
/* OKi, this is the display mode we have been looking for... */
- XF86VidModeSwitchToMode(
- fgDisplay.Display,
- fgDisplay.Screen,
- displayModes[ i ]
- );
- return GL_TRUE;
+ if( !haveToTest ) {
+ XF86VidModeSwitchToMode(
+ fgDisplay.Display,
+ fgDisplay.Screen,
+ displayModes[ i ]
+ );
+ }
+ success = GL_TRUE;
+ break;
}
}
+ XFree( displayModes );
}
- /* Something must have gone wrong */
- return GL_FALSE;
-
# else
/*
* XXX warning fghChangeDisplayMode: missing XFree86 video mode extensions,
#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
unsigned int displayModes = 0, mode = 0xffffffff;
- GLboolean success = GL_FALSE;
/* HDC desktopDC; */
DEVMODE devMode;
}
}
- return success;
-
#endif
+
+ return success;
}