@ -219,8 +219,9 @@ static void MakeWindow(bool full_screen)
// recreate window?
if ( ( full_screen | | _wnd . fullscreen ) & & _wnd . main_wnd ) {
DestroyWindow( _wnd . main_wnd ) ;
HWND wnd = _wnd . main_wnd ;
_wnd . main_wnd = 0 ;
DestroyWindow ( wnd ) ;
}
# if defined(WINCE)
@ -519,6 +520,9 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
break ;
case WM_SIZE :
/* Resizing a destroy window is NOT good */
if ( _wnd . main_wnd = = 0 ) return ;
if ( wParam ! = SIZE_MINIMIZED ) {
/* Set maximized flag when we maximize (obviously), but also when we
* switched to fullscreen from a maximized state */
@ -792,7 +796,9 @@ void VideoDriver_Win32::Stop()
{
DeleteObject ( _wnd . gdi_palette ) ;
DeleteObject ( _wnd . dib_sect ) ;
DestroyWindow ( _wnd . main_wnd ) ;
HWND wnd = _wnd . main_wnd ;
_wnd . main_wnd = 0 ;
DestroyWindow ( wnd ) ;
# if !defined(WINCE)
if ( _wnd . fullscreen ) ChangeDisplaySettings ( NULL , 0 ) ;