Hello. Take a look at this code:
Does that leak? Do I have to set this.Dummy to null before destroying structs or does killing units set them to null indirectly? Or... does destroying structs null all their members? It doesn't seem like it would leak at all to me, but I just want to make sure, since there are a couple of functions with that structure that may be potential leaks to my map. Thanks.
JASS:
struct Example
unit Dummy
static method create takes nothing returns Example
local Example ex = Example.allocate()
//bla bla bla...
set ex.Dummy = CreateUnit(bla bla)
return ex
endmethod
method somemethod takes nothing returns nothing
call KillUnit(this.Dummy)
call this.destroy()
endmethod
endstruct
Does that leak? Do I have to set this.Dummy to null before destroying structs or does killing units set them to null indirectly? Or... does destroying structs null all their members? It doesn't seem like it would leak at all to me, but I just want to make sure, since there are a couple of functions with that structure that may be potential leaks to my map. Thanks.