HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

onDestroy private?

04-11-2007, 06:00 AM#1
MaD[Lion]
Collapse JASS:
    struct stb
        sta H=0
        sta K=0

        method onDestroy takes nothing returns nothing
            if (H!=0) then
                call sta.destroy(H)
            endif
            if (K!=0) then
                call sta.destroy(K)
            endif
        endmethod
    endstruct
isnt it better to make this method private to make sure nothing can call it from outside? Or isnt private supported for this special method?
Cus i just want a constructor, but dont like this to be called if the object isnt destroyed
04-11-2007, 07:03 AM#2
PurgeandFire111
Just wondering...

Is this an actual question, or do you know the answer but you want to see how much we cooperate? lol...

I don't entirely understand what your trying to do, me being a JASS beginner of a beginner... :)
04-11-2007, 07:36 AM#3
MaD[Lion]
this isny really jass, its a preprocessor syntax. Im asking vex tbh.

Just wanna know if im allowed to use private on onDestroy functions
04-11-2007, 12:41 PM#4
Vexorian
onDestroy could be used from outside as a cleanup procedure.

nothing stops you from adding the private keyword to the declaration.
04-11-2007, 01:23 PM#5
MaD[Lion]
ok thnx, i think private makes the cleanup syncronise with the destroy more. So people dont run cleanups without destroying the object