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 ?
 
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
 
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 ?
 
> JASS tag <= How
[noparse]
JASS:
your code here
blah blah
[/noparse]
 
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 The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good
  • The Helper The Helper:
    I would like to see it again like Ghan had it the first time with pagination though - without the pagination that view will not work but with pagination it just might...
  • The Helper The Helper:
    This drink recipe I have had more than a few times back in the day! Mind Eraser https://www.thehelper.net/threads/cocktail-mind-eraser.194720/

      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