mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-03-23 22:15:05 +00:00
OS2_VideoQuit(): avoid double free()ing of displays.
Our caller SDL_VideoQuit() already frees display_modes, driverdata, etc. Noticed in bitwiseworks' version at https://github.com/bitwiseworks/SDL2-os2
This commit is contained in:
parent
fba32ee21f
commit
fe2cc8d86c
|
@ -1612,36 +1612,13 @@ static int OS2_VideoInit(_THIS)
|
||||||
static void OS2_VideoQuit(_THIS)
|
static void OS2_VideoQuit(_THIS)
|
||||||
{
|
{
|
||||||
PSDL_VideoData pVData = (PSDL_VideoData)_this->driverdata;
|
PSDL_VideoData pVData = (PSDL_VideoData)_this->driverdata;
|
||||||
ULONG ulDisplayIdx, ulModeIdx;
|
|
||||||
SDL_VideoDisplay *pSDLDisplay;
|
|
||||||
|
|
||||||
OS2_QuitMouse( _this );
|
OS2_QuitMouse( _this );
|
||||||
|
|
||||||
WinDestroyMsgQueue( pVData->hmq );
|
WinDestroyMsgQueue( pVData->hmq );
|
||||||
WinTerminate( pVData->hab );
|
WinTerminate( pVData->hab );
|
||||||
|
|
||||||
// We support only one display. Free all listed displays data for the future.
|
/* our caller SDL_VideoQuit() already frees display_modes, driverdata, etc. */
|
||||||
for( ulDisplayIdx = 0; ulDisplayIdx < _this->num_displays; ulDisplayIdx++ )
|
|
||||||
{
|
|
||||||
pSDLDisplay = &_this->displays[ulDisplayIdx];
|
|
||||||
|
|
||||||
// Free video mode data (PMODEDATA).
|
|
||||||
if ( pSDLDisplay->desktop_mode.driverdata != NULL )
|
|
||||||
SDL_free( pSDLDisplay->desktop_mode.driverdata );
|
|
||||||
|
|
||||||
// We support only one mode - desktop_mode. Free all modes for the future.
|
|
||||||
for( ulModeIdx = 0; ulModeIdx < pSDLDisplay->num_display_modes;
|
|
||||||
ulModeIdx++ )
|
|
||||||
if ( pSDLDisplay->display_modes[ulModeIdx].driverdata != NULL )
|
|
||||||
SDL_free( pSDLDisplay->display_modes[ulModeIdx].driverdata );
|
|
||||||
|
|
||||||
// Free display data (PDISPLAYDATA).
|
|
||||||
if ( pSDLDisplay->driverdata != NULL )
|
|
||||||
{
|
|
||||||
SDL_free( pSDLDisplay->driverdata );
|
|
||||||
pSDLDisplay->driverdata = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int OS2_GetDisplayBounds(_THIS, SDL_VideoDisplay *display,
|
static int OS2_GetDisplayBounds(_THIS, SDL_VideoDisplay *display,
|
||||||
|
|
Loading…
Reference in a new issue