Descriptive Problem Summary:
Calling the function from Move() results in massive memory consumption. Windows eventually kills the process when it hits the 2gb mark.
Remarking i.Flip() prevents the problem.
To expedite the repro, I added multiple calls to HeroFlip() in Hero/Move()
Hero_Flip()
if (m_sDirection == "WEST")
m_sDirection = "EAST"
var/icon/i = new(src.icon)
i.Flip(EAST)
src.icon = i;
else
m_sDirection = "WEST"
var/icon/i = new(src.icon)
i.Flip(WEST)
src.icon = i;
Numbered Steps to Reproduce Problem:
Start the game
hold down the key 'd' to move the character right
Expected Results:
Memory shouldn't climb to 2gb in a few seconds.
Actual Results:
Memory consumption sky rockets to 2gb.
Notes:
Your probably still irked at me for the last rabbit-hole but I guess I'll have to take a chance.
The code is in shambles as I've been ripping it apart and putting it back together over and over. It could be a poor design issue and likely is. However, the fact that i.Flip() is the one causing the "leak" suggests it could be a bug.
Source was uploaded to the usual place.
Incidentally most of that code can be done outside the if/else; flipping west is the same as flipping east, so the icon handling code is identical in both cases.