• 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.

[Solved] Is there a memory leak when creating units, points, players?

Status
Not open for further replies.
Level 20
Joined
Aug 13, 2013
Messages
1,696
As I said, is there a memory leak in the sc2 trigger editor too? Do I need to remove location leaks and set it null? Is this is like a World Editor?
When I opened a campaign map, I saw that they're not removing points or locations or setting it to null in the script, why?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Do I need to remove location leaks and set it null?
Why on earth should you? That would be a pretty major bug. No user should ever have to remove leaks like that in a garbage collected script system.

Is this is like a World Editor?
WorldEdit did not leak as far as I knew and if it did you could always restart it in a second as it was hardly real time. The actual game process and sessions is entirely a different question and yes, they leaked very badly no mater what you did (unit leaks especially).

When I opened a campaign map, I saw that they're not removing points or locations or setting it to null in the script, why?
Because the reference counter for locals declared outside arguments is decremented correctly so there are no reference leaks (no need to null). Also SC2 uses a garbage collector (like JAVA and C#) so there is no need to manually destroy objects like groups and locations as they are removed when there are no references to them.

SC2 can still leak, but that is mostly non-trigger stuff like units and effect chains that are never removed due to how their data was configured.

Players never leaked in WC3 as they never could be fully recycled and at most 16 existed at any time. Same as how floating text could not be a major leak as at most 100 could exist at any time before the last one is overwritten.
 
Status
Not open for further replies.
Top