Memory leak questions

saw792

Is known to say things. That is all.
Reaction score
280
1. No, You null types that extend agent in common.j
2. No
 

BlueMirage

Trust, but doubt.
Reaction score
39
I also have a question regarding memory leaks.

Do you have to null variables that aren't created in the function? By these, I mean taken values. Example:

JASS:
function DoNull takes nothing returns nothing
    local unit u = udg_SomeUnit //Needs to be nulled
    set u =null
endfunction

function ShouldThisGetNulled takes unit u returns nothing
    set u = null //Is this neccesary???
endfunction
 

Ayanami

칼리
Reaction score
288
I also have a question regarding memory leaks.

Do you have to null variables that aren't created in the function? By these, I mean taken values. Example:

JASS:
function DoNull takes nothing returns nothing
    local unit u = udg_SomeUnit //Needs to be nulled
    set u =null
endfunction

function ShouldThisGetNulled takes unit u returns nothing
    set u = null //Is this neccesary???
endfunction

No, you won't need to null that.
 

Bribe

vJass errors are legion
Reaction score
67
Due to JASS being an interpreter and not a truly compiled language, a lot of things happen behind the scenes.

The 'set' keyword gets hooked by the game engine during application runtime, for example. 'set' in JASS is much slower than most languages because of this. The hook makes it so variables set to handles are 'smart' and remember the handle id even if the object itself is destroyed.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top