Author: cazfi
Date: Wed Feb 22 05:11:42 2017
New Revision: 35059

URL: http://svn.gna.org/viewcvs/freeciv?rev=35059&view=rev
Log:
Fixed 'might be used uninitialized' error from qt-client update_units().

See hrm bug #639513

Modified:
    branches/S2_6/client/gui-qt/repodlgs.cpp

Modified: branches/S2_6/client/gui-qt/repodlgs.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/repodlgs.cpp?rev=35059&r1=35058&r2=35059&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/repodlgs.cpp    (original)
+++ branches/S2_6/client/gui-qt/repodlgs.cpp    Wed Feb 22 05:11:42 2017
@@ -429,7 +429,7 @@
   struct urd_info unit_array[utype_count()];
   struct urd_info unit_totals;
   Unit_type_id utype_id;
-  unittype_item *ui;
+  unittype_item *ui = nullptr;
 
   clear_layout();
   memset(unit_array, '\0', sizeof(unit_array));
@@ -500,7 +500,9 @@
   }
   setUpdatesEnabled(true);
   setFixedWidth(qMin(total_len, gui()->mapview_wdg->width()));
-  setFixedHeight(ui->height() + 60);
+  if (ui != nullptr) {
+    setFixedHeight(ui->height() + 60);
+  }
   layout->update();
   updateGeometry();
 }


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

Reply via email to