Do destructible groups leak?

Accname

2D-Graphics enthusiast
Reaction score
1,462
if i pick all destructibles in a region and do a bunch of actions with the picked destructible, will it leak? cause unit groups do, but i cant set destructible groups in the variable editor...
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
but whats the difference between pick all units within region and pick all destructibles within region? how can the first one leak and the second cant?
 

darkbeer

Beer is Good!
Reaction score
84
well if you use the
Code:
 Pick every unit in .....
function, it takes a group, which will be automatically created when you use gui actions like "all units in playable map area".

in jass:

JASS:
function ForGroupBJ takes group whichGroup, code callback returns nothing // <-- whichGroup will leak here if you dont clean it
    // If the user wants the group destroyed, remember that fact and clear
    // the flag, in case it is used again in the callback.
    local boolean wantDestroy = bj_wantDestroyGroup
    set bj_wantDestroyGroup = false

    call ForGroup(whichGroup, callback)

    // If the user wants the group destroyed, do so now.
    if (wantDestroy) then
        call DestroyGroup(whichGroup)
    endif
endfunction


and for the Pick every destructable:

JASS:
native EnumDestructablesInRect takes rect r, boolexpr filter, code actionFunc returns nothing


as you can see its a native function and nothing will be created therefore noithing leaks.
 

Romek

Super Moderator
Reaction score
963
Pick all units created a handle (unit group)
Pick all destructibles doesn't.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
well whatever. thanks to all of you.

Edit: i dont know but for some reason i cant give rep to acehart...
 
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