Will this leaks ?

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
JASS:
set tl = GetUnitLoc(c)
    set i = 1
    loop
        exitwhen i > 3
        set p = GetNearestUnit(tl, boolexpr ,aoe)
        set d = CreateUnitAtLoc( GetOwningPlayer(c), 'h006', tl, 0)
        call UnitApplyTimedLife( d, 'BTLF', 10)
        call UnitAddAbility(d,'A01T'
        call UnitAddAbility(d,'Amrf')
        call UnitRemoveAbility(d,'Amrf')
        call SetUnitFlyHeight(d,143,0)
        call IssueTargetOrder( d, "acidbomb", p )
        call Knife(d,p,dam,'BNab')
        set i = i + 1
     endloop
     call RemoveLocation(tl)
     call DestroyGroup(g)



i set location tl on top of this loop and remove it after using in that loop
will this location leaks ?
 

Doomhammer

Bob Kotick - Gamers' corporate spoilsport No. 1
Reaction score
67
it will.

you need to null groups, units and locations at the end of your trigger:

JASS:
set g=null
set d=null
set p=null
set tl=null


tip1): when posting in the jass zone, write your code as JASS tag

tip2) get used to write in an easy-to-read format using indents

tip3) before asking, always check out the tutorial section on thehelpers using the forum search on the keyword of your problem (e.g. "leak")

here are two detailed tutorials which more than answer your question:

http://www.thehelper.net/forums/showthread.php?t=27219&highlight=leak
http://www.thehelper.net/forums/showthread.php?t=27242&highlight=leak

and here's another to help you improve your coding

http://www.thehelper.net/forums/showthread.php?t=48749
 

Tom_Kazansky

--- wraith it ! ---
Reaction score
157
tip1): when posting in the jass zone, write your code as JASS tag <= How ?:confused:

Thanks.

And one more question:
code1:
JASS:
        set tl = GetUnitLoc(c)
        set d = CreateUnitAtLoc( GetOwningPlayer(c), &#039;h000&#039;, tl, 0)
        call RemoveLocation(tl)
        set tl = GetUnitLoc(c)
        set tl2 = PolarProjectionBJ( tl, 50, 0)
        call SetUnitPositionLoc( d, tl2)
        call RemoveLocation(tl2)
        call RemoveLocation(tl)
        ...
        set c = null
        set d = null
        set tl = null
        set tl2 = null


code2:
JASS:
        set tl = GetUnitLoc(c)
        set d = CreateUnitAtLoc( GetOwningPlayer(c), &#039;h000&#039;, tl, 0)
        set tl2 = PolarProjectionBJ( tl, 50, 0)
        call SetUnitPositionLoc( d, tl2)
        call RemoveLocation(tl2)
        call RemoveLocation(tl)
        ...
        set c = null
        set d = null
        set tl = null
        set tl2 = null


Which code is better ?
 

SFilip

Gone but not forgotten
Reaction score
634
> JASS tag <= How
[noparse]
JASS:
your code here
blah blah
[/noparse]
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
omg...Sfilip...
How u do that? Just use normal jass tag but the "your code here blah blah" arent in the tag....How come it doesnt create a tag?

>>And one more question

the C is not setted or localed....so there will be no C in the code...code arent working
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top