Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2003:
[Freeciv-Dev] Re: (PR#6597) Huge memory leak with autogame
Home

[Freeciv-Dev] Re: (PR#6597) Huge memory leak with autogame

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: i-freeciv-lists@xxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6597) Huge memory leak with autogame
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 22 Oct 2003 06:39:50 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Raimar Falke wrote:
> On Tue, Oct 21, 2003 at 11:37:53PM -0700, Raimar Falke wrote:
> 
>>
>>I'm running an autogame with the rc-bug from the PR#6260 thread. The
>>civserver process enlarged itself to 710MB before it got killed.
> 
> 
> Found it. Please check and apply.

Looks good to me...except that you missed a place.

jason

Index: ai/aidiplomat.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aidiplomat.c,v
retrieving revision 1.25
diff -u -r1.25 aidiplomat.c
--- ai/aidiplomat.c     2003/10/13 07:30:57     1.25
+++ ai/aidiplomat.c     2003/10/22 13:38:43
@@ -168,6 +168,9 @@
 
     find_city_to_diplomat(pplayer, punit, &acity, &time_to_dest, map);
 
+    pf_destroy_map(map);
+    destroy_unit_virtual(punit);
+
     if (acity == NULL || BV_ISSET(ai->stats.diplomat_reservations, acity->id)) 
{
       /* Found no target or city already considered */
       return;
@@ -238,7 +241,6 @@
       choice->choice = u;
       BV_SET(ai->stats.diplomat_reservations, acity->id);
     }
-    destroy_unit_virtual(punit);
   }
 }
 
@@ -679,4 +681,5 @@
       }
     }
   }
+  pf_destroy_map(map);
 }

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