The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: jamespetts on September 02, 2015, 04:30:40 PM

Title: Uninitialised destruction
Post by: jamespetts on September 02, 2015, 04:30:40 PM
The new patch (https://github.com/aburch/simutrans/commit/4b20a44da5508797d83e85d2953746dc7c9fd499) to avoid doing unnecessary things when destroying a map is useful, but the variable "destroy" is uninitialised when the map is created, which causes all sorts of problems. Adding destroy = false; to the constructor for karte_t solves these problems.
Title: Re: Uninitialised destruction
Post by: kierongreen on September 02, 2015, 05:34:49 PM
Committed in 7571, thanks.
Title: Re: Uninitialised destruction
Post by: Dwachs on September 03, 2015, 06:06:28 AM
thank you both! I totally missed that.
Title: Re: Uninitialised destruction
Post by: kierongreen on September 03, 2015, 06:57:42 AM
Is karte_t actually reused? If not we don't need to set destroying back to false at the end of destroy().
Title: Re: Uninitialised destruction
Post by: prissi on September 03, 2015, 09:28:55 AM
karte_t was reused everytime you load/create a game and never ever really freed. Or rather destroy is called before loading/creating a map. So it exists for eternity. Hence there was once a patch to remove it completely.