Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] (PR#11350) handle_city_short_info Does not use create_city
Home

[Freeciv-Dev] (PR#11350) handle_city_short_info Does not use create_city

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#11350) handle_city_short_info Does not use create_city_virtual.
From: "Benedict Adamson" <badamson@xxxxxxxxxxx>
Date: Sun, 5 Dec 2004 08:08:41 -0800
Reply-to: rt@xxxxxxxxxxx

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

The client creates and registers city structures in two places:
handle_city_info creates a new city using create_city_virtual; 
handle_city_short_info uses a simple fc_malloc. The function 
remove_city_virtual is always used to destroy these city structures.

However, it seems to me that handle_city_short_info should also create 
new cities using create_city_virtual. I suspect some of the code for 
setting default values could then be removed. More importantly, it 
prevents bugs when fields, such as unit_lists, are added to 'struct 
city' that should be cleanly removed (to prevent memory leaks) but must 
also be initialised.





[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#11350) handle_city_short_info Does not use create_city_virtual., Benedict Adamson <=