Author: mir3x
Date: Wed Dec  2 13:05:17 2015
New Revision: 30834

URL: http://svn.gna.org/viewcvs/freeciv?rev=30834&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_6/client/gui-qt/dialogs.cpp

Modified: branches/S2_6/client/gui-qt/dialogs.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/dialogs.cpp?rev=30834&r1=30833&r2=30834&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/dialogs.cpp     (original)
+++ branches/S2_6/client/gui-qt/dialogs.cpp     Wed Dec  2 13:05:17 2015
@@ -2550,6 +2550,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();
@@ -2559,11 +2560,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