• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[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
 
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.
Back
Top