[General] Memory Leaks

Status
Not open for further replies.
Level 1
Joined
May 20, 2015
Messages
2
Will this trigger create any memory leaks?

Event:
Time elapsed is 2.00 seconds

Actions:
Set Quickpoint: Position of Hero
Create destructible at Quickpoint
Set Quickpoint: Position of Enemy
Create destructible at Quickpoint
Custom script: call RemoveLocation (udg_QuickPoint)

Thanks in advance
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
yes, 1 location is leaked forever.

This is because when you do "Position of X", the game basically creates new location, so it reserves a bit of memory and puts the contents in there.

Then you do it again, but you stop pointing your finger to the old bit of reserved memory, and start pointing to the new one.

Then you cann RemoveLocation, so the game looks at your finger, looks where it is pointing at, and goes and demolishes(unreserves) that bit of memory. But as you can see, the first one cant be demolished, because there is nothing pointing fingers at it.

Basically, you have to call RemoveLocation before "Set ... to Position of X"
 
Status
Not open for further replies.
Top