Does I2S leak? Do non-local strings need to be cleaned up?

afisakov

You can change this now in User CP.
Reaction score
37
I have a number of lines of the form:
Code:
call DisplayTimedTextToPlayer(GetOwningPlayer(GetTriggerUnit()),0,0,1.00,(GetHeroProperName(GetTriggerUnit())+": |cffff0000quest 1 reward: "+I2S(g)+" gold, "+I2S(exp)+" exp|R"))
this is an example but many of them are in same format. I already display to player to avoid player group leaks.
Does anything else from this line leak and need to be cleaned up?

P.S. "g" and "exp" are local integers

I asked because I saw some map makers define the string to a variable and then set it to null later, but I never knew why or if that was needed.
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
You don't need to null strings. Strings can leak, sort of. They are actually all stored in a table, but the memory usage is so insignificant that you don't need to worry about it. Plus, it is helpful if you later want to reuse that string.

Also, there is no way to clear that table, so again you don't need to worry about it. :) Assigning it to a variable and nulling it is pointless.
 

afisakov

You can change this now in User CP.
Reaction score
37
thank you very much for the replies. that makes one less thing to worry about on this map.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top