IsInDestroy

 (Available in 01 TS COM - TS_COM_IUnknown)

Purpose

Test if the object is being destroyed

Syntax

IF SELF:IsInDestroy

Description

Test if the object is being destroyed, this flag is only TRUE while the 'Destroy()' method is being executed. When the 'Destroy()' method is done the 'IsDestroyed' access will return TRUE.

Example

METHOD SomeMethod( ) CLASS SomeIClass
   DO CASE
   CASE SELF:IsInDestroy
//    Do nothing
   CASE SELF:IsDestroyed
//    Do nothing
   OTHERWISE
//    Do the work
      ... 
   END
   RETURN...

Source

ACCESS IsInDestroy CLASS TS_IUnknown
LOCAL lIsInDestroy AS LOGIC
   TSTrace Enter
   IF LOGIC( _CAST, _AND( SELF:_ObjectStat1, TS_OBJSTAT1_INDESTROY  ; ...
  ... ) )
      lIsInDestroy:=TRUE
   ELSE
      lIsInDestroy:=FALSE
   END
   TSTrace Leave
RETURN lIsInDestroy