• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[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 63
Joined
Jan 18, 2005
Messages
27,195
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