fixed assertion warning when building with SDL 2.0.6 for Android
authorHolger Schemel <info@artsoft.org>
Tue, 26 Sep 2017 15:08:59 +0000 (17:08 +0200)
committerHolger Schemel <info@artsoft.org>
Tue, 26 Sep 2017 15:08:59 +0000 (17:08 +0200)
src/libgame/sdl.c

index 3afecaf918c2e7bd991e3ec36e335cad334a65b3..214859df78ef187e584ce4b42837b653a0f6e0f4 100644 (file)
@@ -532,11 +532,7 @@ inline static void SDLInitVideoBuffer_VideoBuffer(boolean fullscreen)
   SDLSetWindowIcon(program.icon_filename);
 
   /* set window and icon title */
-#if defined(TARGET_SDL2)
-  SDL_SetWindowTitle(sdl_window, program.window_title);
-#else
-  SDL_WM_SetCaption(program.window_title, program.window_title);
-#endif
+  SDLSetWindowTitle();
 }
 
 inline static void SDLInitVideoBuffer_DrawBuffer()
@@ -830,6 +826,9 @@ boolean SDLSetVideoMode(boolean fullscreen)
 void SDLSetWindowTitle()
 {
 #if defined(TARGET_SDL2)
+  if (sdl_window == NULL)
+    return;
+
   SDL_SetWindowTitle(sdl_window, program.window_title);
 #else
   SDL_WM_SetCaption(program.window_title, program.window_title);