Unit Leak Knowledge Equal to null

Status
Not open for further replies.
Level 5
Joined
Oct 24, 2007
Messages
90
Hello. Take a look at this code:

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.
 
Status
Not open for further replies.
Top