Author: cazfi
Date: Thu Feb  5 03:04:42 2015
New Revision: 27987

URL: http://svn.gna.org/viewcvs/freeciv?rev=27987&view=rev
Log:
Initialize the variable telling if the citydlg system has been initialized 
itself.

See patch #5780

Modified:
    trunk/client/gui-gtk-2.0/citydlg.c
    trunk/client/gui-gtk-3.0/citydlg.c

Modified: trunk/client/gui-gtk-2.0/citydlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-2.0/citydlg.c?rev=27987&r1=27986&r2=27987&view=diff
==============================================================================
--- trunk/client/gui-gtk-2.0/citydlg.c  (original)
+++ trunk/client/gui-gtk-2.0/citydlg.c  Thu Feb  5 03:04:42 2015
@@ -195,7 +195,7 @@
 static GtkRcStyle *info_label_style[NUM_INFO_STYLES] = { NULL, NULL, NULL };
 
 static struct dialog_list *dialog_list;
-static bool city_dialogs_have_been_initialised;
+static bool city_dialogs_have_been_initialised = FALSE;
 static int canvas_width, canvas_height;
 static int new_dialog_def_page = OVERVIEW_PAGE;
 static int last_page = OVERVIEW_PAGE;
@@ -356,8 +356,9 @@
 *****************************************************************/
 static struct city_dialog *get_city_dialog(struct city *pcity)
 {
-  if (!city_dialogs_have_been_initialised)
+  if (!city_dialogs_have_been_initialised) {
     initialize_city_dialogs();
+  }
 
   dialog_list_iterate(dialog_list, pdialog) {
     if (pdialog->pcity == pcity)
@@ -547,6 +548,7 @@
     close_city_dialog(dialog_list_get(dialog_list, 0));
   }
   dialog_list_destroy(dialog_list);
+  
   city_dialogs_have_been_initialised = FALSE;
 }
 

Modified: trunk/client/gui-gtk-3.0/citydlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-gtk-3.0/citydlg.c?rev=27987&r1=27986&r2=27987&view=diff
==============================================================================
--- trunk/client/gui-gtk-3.0/citydlg.c  (original)
+++ trunk/client/gui-gtk-3.0/citydlg.c  Thu Feb  5 03:04:42 2015
@@ -194,7 +194,7 @@
 };
 
 static struct dialog_list *dialog_list;
-static bool city_dialogs_have_been_initialised;
+static bool city_dialogs_have_been_initialised = FALSE;
 static int canvas_width, canvas_height;
 static int new_dialog_def_page = OVERVIEW_PAGE;
 static int last_page = OVERVIEW_PAGE;
@@ -350,8 +350,9 @@
 *****************************************************************/
 static struct city_dialog *get_city_dialog(struct city *pcity)
 {
-  if (!city_dialogs_have_been_initialised)
+  if (!city_dialogs_have_been_initialised) {
     initialize_city_dialogs();
+  }
 
   dialog_list_iterate(dialog_list, pdialog) {
     if (pdialog->pcity == pcity)
@@ -563,10 +564,12 @@
   if (!city_dialogs_have_been_initialised) {
     return;
   }
+
   while (dialog_list_size(dialog_list)) {
     close_city_dialog(dialog_list_get(dialog_list, 0));
   }
   dialog_list_destroy(dialog_list);
+
   city_dialogs_have_been_initialised = FALSE;
 }
 


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

Reply via email to