Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2004:
[Freeciv-Dev] (PR#9980) placed_map crash in mapgen
Home

[Freeciv-Dev] (PR#9980) placed_map crash in mapgen

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#9980) placed_map crash in mapgen
From: "Marcelo Burda" <mburda@xxxxxxxxx>
Date: Wed, 8 Sep 2004 01:34:35 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=9980 >

> [jdorje - Mer. Sep. 08 06:51:57 2004]:
> 
> Marcelo, this is surely a bug for you!
> 
> If necessary we can get access to the debugger for the crash (core & 
> executable).
> 
> jason
> 
> 
> -------- Original Message --------
> Subject: [Freeciv-Dev] civserver crashed: 
> http://pubserver.freeciv.org/games/330563
> Date: Tue, 7 Sep 2004 23:38:38 -0700
> From: freeciv@xxxxxxxxxxxxxxxxxxxxx
> To: freeciv-dev@xxxxxxxxxxx
> 
> 
> 
> 

this patch fix the 2 abourt bugs of generator 2 (one known the other
forbide :-) ) 
gen 3,4 has not the some proble as its abort befor call world_init()
diff -ruN -Xfreeciv/diff_ignore freeciv/server/mapgen.c 
freeciv_fix/server/mapgen.c
--- freeciv/server/mapgen.c     2004-09-08 04:38:14.000000000 +0200
+++ freeciv_fix/server/mapgen.c 2004-09-08 08:26:18.911635272 +0200
@@ -2515,8 +2515,11 @@
                        * (map.xsize - spares)) / 100;
   totalweight = 100 * game.nplayers;
 
+  assert(placed_map == NULL);
+
   while (!done && bigfrac > midfrac) {
     done = TRUE;
+    if ( placed_map != NULL ) { destroy_placed_map(); }
     initworld(pstate);
     
     /* Create one big island for each player. */
@@ -2546,6 +2549,11 @@
     /* We could never make adequately big islands. */
     freelog(LOG_NORMAL, _("Falling back to generator %d."), 1);
     map.generator = 1;
+
+    /* init world create this map, destroy it before abort */
+    destroy_placed_map();
+    free(height_map);
+    height_map = NULL;
     return;
   }
 

[Prev in Thread] Current Thread [Next in Thread]