- Joined
- Jul 10, 2007
- Messages
- 6,306
local integer i=0
loop
exitwhen i>8190
set s[i]="djipwejfiwejfewjpwje'okweewiljweligjfreioe;jroeoigtt/reokgkreg;iojtr;gjrtojiweijgrerjglreijlwgerihjwreoijgeriwjgrewoijewirojiwjiowjguwjgwjgoiwjoirjergjoirewjgrjeglksdjfijetiu4hreewjgkhuikhw7y"
set i=i+1
endloop
Okay now, I agree that it might be "good practice" to null players, but strings? You've got to be kidding me.Also, nulling all handles is a good programming practice.
Get used to it.
Just null everything.
In some very rare cases, even strings need to be 'nulled'.
JASS:local integer i=0 loop exitwhen i>8190 set s[i]="djipwejfiwejfewjpwje'okweewiljweligjfreioe;jroeoigtt/reokgkreg;iojtr;gjrtojiweijgrerjglreijlwgerihjwreoijgeriwjgrewoijewirojiwjiowjguwjgwjgoiwjoirjergjoirewjgrjeglksdjfijetiu4hreewjgkhuikhw7y" set i=i+1 endloop
That would leak a total of 1.8 MB 0.o (Equivalent to about 180 special effects)
So I can safely tell you that nulling strings does absolutely nothing.
Each time a new string is used, it is cached and stored into a table for further access and usage. And they are never removed from the table during run-time. That is WC3's way of optimizing the speed at which strings are accessed and operations with them are done.
It makes sense, since it fits with the short name convention. (joke ofc)
Player reference counting doesn't do anything since they are never destroyed, so there is no point to nulling them : )
static readonly Event event