Author: cazfi
Date: Sat Nov  5 08:16:40 2016
New Revision: 34396

URL: http://svn.gna.org/viewcvs/freeciv?rev=34396&view=rev
Log:
Sdl-clients ignore requests from client-common code to switch theme once there 
is one already loaded.

This avoids some crashes reported by Jacob Nevins <jtn>

See bug #25117

Modified:
    trunk/client/gui-sdl2/themes.c

Modified: trunk/client/gui-sdl2/themes.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl2/themes.c?rev=34396&r1=34395&r2=34396&view=diff
==============================================================================
--- trunk/client/gui-sdl2/themes.c      (original)
+++ trunk/client/gui-sdl2/themes.c      Sat Nov  5 08:16:40 2016
@@ -37,6 +37,11 @@
   char buf[strlen(directory) + strlen(DIR_SEPARATOR) + strlen(theme_name)
            + strlen(DIR_SEPARATOR "theme") + 1];
 
+  if (theme != NULL) {
+    /* We don't support changing theme once it has been loaded */
+    return;
+  }
+
   /* free previous loaded theme, if any */
   theme_free(theme);
   theme = NULL;
@@ -53,9 +58,6 @@
 *****************************************************************************/
 void gui_clear_theme(void)
 {
-  theme_free(theme);
-  theme = NULL;
-
   if (!load_theme(gui_options.gui_sdl2_default_theme_name)) {
     /* TRANS: No full stop after the URL, could cause confusion. */
     log_fatal(_("No Sdl2-client theme was found. For instructions on how to "


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to