aenemenate/Landlord

Build mode causes stack overflow

Closed this issue · 1 comments

I've already addressed a lot of memory leaks in the process of trying to fix this issue but it seems I'll have to recode it from scratch since a younger and much stupider me left quite the mess :P

Didn't have to re-code it, I found out the problem actually stemmed from the serializer leaving memory leaks, not from my code. Block.Copy() being called when a building is finalized uses the serializer to serialize and deserialize the data. This left some memory in the cache so I simply force garbage collection whenever it's called. It's not a bad performance hit since the only time I call that function is to place a building, a rare occurrence in game.