OneLife icon indicating copy to clipboard operation
OneLife copied to clipboard

Possible memory leak in graveinfo

Open JustinLove opened this issue 7 years ago • 3 comments

https://github.com/jasonrohrer/OneLife/blob/e2577913eb6ba5772f13fd0953d3e8bf693ca4f1/gameSource/LivingLifePage.cpp#L11294

When the game creates a relation string for a grave info, I don't see where that string is deleted. Perhaps I don't fully understand the memory semantics of getElementString

JustinLove avatar Jun 01 '19 14:06 JustinLove

You're true.

getElementString has "new". https://github.com/jasonrohrer/minorGems/blob/master/util/SimpleVector.h#L708

So its need free.

relationName be left or override by here. https://github.com/jasonrohrer/OneLife/blob/e2577913eb6ba5772f13fd0953d3e8bf693ca4f1/gameSource/LivingLifePage.cpp#L11327

Never be free. It will be memory leak.

AlecYawata avatar Jun 02 '19 14:06 AlecYawata

Bug comes out of this, I think, when moving piles of bones. Is it a good illustration of this memory leak? https://onehouronelife.com/forums/viewtopic.php?id=6838

rolandmartial avatar Jun 05 '19 10:06 rolandmartial

That is another issue. Memory leak only performance problem. Please make new issue.

AlecYawata avatar Jun 06 '19 06:06 AlecYawata