struct leak check

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
JASS:
function Movement takes nothing returns boolean
    local DATA data = TT_GetData()
    local integer i = GetPlayerId(GetOwningPlayer(data.c))
    if(DATA<i>.side == 1) then //Left
        call SetUnitFacing(DATA<i>.c,GetUnitFacing(Car<i>.c) + 3)
    elseif(Car<i>.side == 2) then //Right
        call SetUnitFacing(DATA<i>.c,GetUnitFacing(Car<i>.c) - 3)
    endif
    return(DATA<i>.side == 0)  
endfunction</i></i></i></i></i></i></i>

the struct:
JASS:
struct DATA extends array
    unit c
    integer side
    integer direction
endstruct

does the local struct data leaks?
also tell me how to clean it if it does

thanks in advance
 

RaiJin

New Member
Reaction score
40
doesn't leak to me

and make sure u destroy the instance when your done using it
 

Builder Bob

Live free or don't
Reaction score
249
A struct extending array cannot really leak anything in the sense you normally see leaking struct instances. The usage in the function Movement looks strange to me though.
 
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