Author: mir3x
Date: Wed Dec  2 13:05:08 2015
New Revision: 30833

URL: http://svn.gna.org/viewcvs/freeciv?rev=30833&view=rev
Log:
Qt-client could crash when unit selection widget was open, and 
then user connected to another game to observe. 
Fixed.

See bug #24122


Modified:
    branches/S2_5/client/gui-qt/dialogs.cpp

Modified: branches/S2_5/client/gui-qt/dialogs.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-qt/dialogs.cpp?rev=30833&r1=30832&r2=30833&view=diff
==============================================================================
--- branches/S2_5/client/gui-qt/dialogs.cpp     (original)
+++ branches/S2_5/client/gui-qt/dialogs.cpp     Wed Dec  2 13:05:08 2015
@@ -2339,6 +2339,7 @@
 void unit_select::update_units()
 {
   int i = 1;
+  struct unit_list *punit_list;
 
   if (utile == NULL) {
     struct unit *punit = head_of_units_in_focus();
@@ -2348,11 +2349,14 @@
   }
   unit_list.clear();
   if (utile != nullptr) {
-    unit_list_iterate(utile->units, punit) {
-      if (i > show_line * 4)
-        unit_list.push_back(punit);
-      i++;
-    } unit_list_iterate_end;
+    punit_list = utile->units;
+    if (punit_list != nullptr) {
+      unit_list_iterate(utile->units, punit) {
+        if (i > show_line * 4)
+          unit_list.push_back(punit);
+        i++;
+      } unit_list_iterate_end;
+    }
   }
   if (unit_list.count() == 0) {
     close();


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

Reply via email to