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.
Committed in 7571, thanks.
thank you both! I totally missed that.
Is karte_t actually reused? If not we don't need to set destroying back to false at the end of destroy().
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.