[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]
<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 <=
|
|