The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Topic started by: killwater on December 09, 2012, 12:26:17 PM

Title: RC crash when rotating map
Post by: killwater on December 09, 2012, 12:26:17 PM
Hello
There is a problem with rotating map more then once: it gives an error: "FATAL ERROR: sim_new_handler() OUT OF MEMORY or other error allocating a new object"
This seem to be connected with both speed of rotating and amount of rotations. New games with few vehicles require more rotations to crash than developed one.
Title: Re: RC crash when rotating map
Post by: jamespetts on December 09, 2012, 12:40:11 PM
Thank you for the report.

Hmm, this looks like a possible memory leak. Bernd - any thoughts on this?
Title: Re: RC crash when rotating map
Post by: Bernd Gabriel on December 11, 2012, 10:49:24 PM
Rotating a 1024x768 game consumed about 2 MB per rotation for the first 4 rotations.
The 5th rotation crashed the game:

void stadt_t::rotate90( const sint16 y_size ) produces ways too many city connexions!
I saw it generating 43386 new connections for originally 16.
Most probably it is not the best idea to remove items from connected_cities without using the iterator while iterating through it.

I pushed a fix to my "112.x merge" branch.
Title: Re: RC crash when rotating map
Post by: jamespetts on December 12, 2012, 12:35:04 AM
Thank you for that - merged with my own 112.x branch.