hedgewars/CCHandlers.inc
changeset 1525 311d0ab35d98
parent 1379 39cfee7a5be5
child 1639 89b536a3cf3c
--- a/hedgewars/CCHandlers.inc	Mon Dec 01 14:24:17 2008 +0000
+++ b/hedgewars/CCHandlers.inc	Thu Dec 04 21:14:03 2008 +0000
@@ -481,7 +481,7 @@
 {$IFDEF DEBUGFILE}
 AddFileLog('Freeing old primary surface...');
 {$ENDIF}
-SDL_FreeSurface(SDLPrimSurface);
+if SDLPrimSurface <> nil then SDL_FreeSurface(SDLPrimSurface);
 
 SDLPrimSurface:= SDL_SetVideoMode(cScreenWidth, cScreenHeight, cBits, flags);
 SDLTry(SDLPrimSurface <> nil, true);