<URL: http://bugs.freeciv.org/Ticket/Display.html?id=37519 >

On 3/4/07, Mike Kaufman <[EMAIL PROTECTED]> wrote:
>
> loading a savegame when the client is connected to a server causes this
> assertion:
>
> civclient: packhand.c:2480: handle_ruleset_base: Assertion
> `pbase->reqs.size == p->reqs_count' failed.

 Fix


 - ML

diff -Nurd -X.diff_ignore freeciv/common/base.c freeciv/common/base.c
--- freeciv/common/base.c	2007-03-02 15:10:46.000000000 +0200
+++ freeciv/common/base.c	2007-03-05 00:36:22.000000000 +0200
@@ -18,6 +18,7 @@
 #include <assert.h>
 
 #include "base.h"
+#include "game.h"
 #include "tile.h"
 #include "unit.h"
 
@@ -122,3 +123,13 @@
     requirement_vector_init(&base_types[i].reqs);
   }
 }
+
+/****************************************************************************
+  Free the memory associated with base types
+****************************************************************************/
+void base_types_free(void)
+{
+  base_type_iterate(pbase) {
+    requirement_vector_free(&pbase->reqs);
+  } base_type_iterate_end;
+}
diff -Nurd -X.diff_ignore freeciv/common/base.h freeciv/common/base.h
--- freeciv/common/base.h	2007-03-03 23:02:08.000000000 +0200
+++ freeciv/common/base.h	2007-03-05 00:34:16.000000000 +0200
@@ -58,6 +58,7 @@
 struct base_type *base_type_get_by_id(Base_type_id id);
 
 void base_types_init(void);
+void base_types_free(void);
 
 #define base_type_iterate(pbase)                                            \
 {                                                                           \
diff -Nurd -X.diff_ignore freeciv/common/game.c freeciv/common/game.c
--- freeciv/common/game.c	2007-03-03 23:02:09.000000000 +0200
+++ freeciv/common/game.c	2007-03-05 00:32:16.000000000 +0200
@@ -367,6 +367,7 @@
   nations_free();
   unit_types_free();
   improvements_free();
+  base_types_free();
   city_styles_free();
   terrains_free();
   ruleset_cache_free();
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to