Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2004:
[Freeciv-Dev] Re: (PR#6898) leaks in game_load / player_load
Home

[Freeciv-Dev] Re: (PR#6898) leaks in game_load / player_load

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: bh@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6898) leaks in game_load / player_load
From: "Mike Kaufman" <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 29 Aug 2004 10:05:37 -0700
Reply-to: rt@xxxxxxxxxxx

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

After looking at this, you are incorrect. player_load() does _not_ call
player_init(). It calls server_player_init() which doesn't call
player_init() (it used too a long time ago, but no longer). load_command()
calls game_init() which takes care of the player_inits().

So with regard to the allot_island_improvs, the code seems to be correct.
However, ai_data_init() gets called twice. once in server_player_init() and
then right afterwards. Here is a patch to fix it.

-mike

diff -Nur -Xcvs/diff_ignore snap/server/savegame.c snap-leak/server/savegame.c
--- snap/server/savegame.c      2004-08-28 10:38:55.000000000 -0500
+++ snap-leak/server/savegame.c 2004-08-29 12:04:08.171361914 -0500
@@ -1429,7 +1429,6 @@
   int id;
 
   server_player_init(plr, TRUE);
-  ai_data_init(plr);
   ai = ai_data_get(plr);
 
   plr->ai.barbarian_type = secfile_lookup_int_default(file, 0, 
"player%d.ai.is_barbarian",

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#6898) leaks in game_load / player_load, Mike Kaufman <=