Axit

 (Available in 00 TS Tools(Base) - TS_Tools_Destructor)

Purpose

Destructor activation, Called by the GC

Syntax

oSomeClass:Axit( )

Description

Do not override this method ( when posible <g> ), use the 'Destroy()' method to do the real destructive work. It is not guarantied that the 'Axit()' method is called.

It is guarantied that the 'Destroy()' method is called.

The destructor class is instantiated from one of the 'UnRegisterOwner' methods, whenever a 'UnRegisterOwner' returns a 'Destructor' the application must call it's 'Axit' method. The destructor class should not be instantiated by the application code.

Example

METHOD...( )CLASS...
LOCAL oDestructor AS OBJECT
oDestructor:=oSomeClass:UnRegisterOwner( SELF )
IF IsObject( oDestructor ) .AND. oDestructor<>NULL_OBJECT
   oDestructor:Axit( )
   oDestructor:=NULL_OBJECT
END
RETURN...

Source

METHOD Axit( ) CLASS TS_Destructor
   TSTrace Enter
   IF !InCollect( )
      UnRegisterAxit( SELF )
   END
   IF SELF:_Axited==1U
      SELF:_Axited:=2U
      IF SELF:_Destroyed==0U
         SELF:_Destroyed:=1U
         SELF:Destroy( )
      END
   ELSE
      SELF:_Axited:=2U
   END
   TSTrace Leave DESTROY
RETURN NIL