• 🏆 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!

Does floating text above unit leak?

Status
Not open for further replies.
Level 12
Joined
May 22, 2015
Messages
1,051
  • Trigger
  • Events
  • Conditions
  • Actions
    • Floating Text - Create floating text above TriggeringUnit() ...
    • Floating Text - Create floating text at myPoint ...
Is it safe to use the "create floating text above unit" action or should I just be using the point one and clear the point myself? Safe as in doesn't leak memory.

Thanks in advance.
 
Level 3
Joined
May 28, 2015
Messages
41
from what i've seen for memory leaks that location would leak so you need to store that point in a var and after you created the text clear that var manualy

p.s. don't listen to just me...i'm just guessing from what i've seen and don't really know the outcome of that trigger
 
Level 12
Joined
May 22, 2015
Messages
1,051
from what i've seen for memory leaks that location would leak so you need to store that point in a var and after you created the text clear that var manualy

p.s. don't listen to just me...i'm just guessing from what i've seen and don't really know the outcome of that trigger

The one for "above unit" doesn't create a point from what I can see in GUI.

Okay I looked through the JASS here: http://jass.sourceforge.net/doc/api/Blizzard_j-source.shtml

I think the "TextTag" stuff is floating text. Seems like "above unit" is probably safe. When I convert it to JASS, though, I think I'll just use the native function for setting the position based on x and y values.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Floating text can leak but the leak is finite. Specifically once 100 floating text exist on the map the last created one will be constantly recycled for any new floating text creations. Hence the leak is finite and limited to 100 floating text. The problem is that at that stage it might interfere with the player's user experience as not all text they need to see may be visible.

With floating text that has a finite life you can always give it an automatic expiry time. This means it cannot leak as it gets automatically destroyed after a certain amount of time.

If using local keyword declared local handle variables do remember to make sure they have a null value by the time a function returns or the handle index will not ever be able to be recycled which could cause a different sort of leak and possibly mess up floating text since floating text only has a 100 handle block if I recall.
 
Level 12
Joined
May 22, 2015
Messages
1,051
Floating text can leak but the leak is finite. Specifically once 100 floating text exist on the map the last created one will be constantly recycled for any new floating text creations. Hence the leak is finite and limited to 100 floating text. The problem is that at that stage it might interfere with the player's user experience as not all text they need to see may be visible.

With floating text that has a finite life you can always give it an automatic expiry time. This means it cannot leak as it gets automatically destroyed after a certain amount of time.

If using local keyword declared local handle variables do remember to make sure they have a null value by the time a function returns or the handle index will not ever be able to be recycled which could cause a different sort of leak and possibly mess up floating text since floating text only has a 100 handle block if I recall.

Thanks! I should have specified that I was only worried about the location leaks. This is good information, though.
 
Status
Not open for further replies.
Top