Loading...
 

CreateTransObject

CreateTransObject

CreateTransObject(CX_xxxxx)

parameters: Identifier of a class

Stack
Stack Description
Stack(In) -
Stack(Out) the just created (transient) object
 

CreateTransObject(STACK)

Stack
Stack Description
Stack(In) Identifier of a class
Stack(Out) the just created (transient) object

An object is created in transient memory (on the heap). Thereby the default constructor of the class is called. If no variable and no stack entry refers to the transient object anymore, InstantView® assumes that this object is no longer needed and automatically deletes it at the next garbage collection. InstantView® does not check whether the object to be deleted is referenced by another object.
However, InstantView® can detect access to a deleted object in a special test mode (see KeepGarbage instruction). In such a case you must either assign the referenced object to a variable or use the following variant:

CreateTransObject(CX_xxxxx, KEEP)

parameters: Identifier of a class, flag KEEP

Stack
Stack Description
Stack(In) -
Stack(Out) the just created (transient) object

CreateTransObject(, KEEP)

Stack
Stack Description
Stack(In) Identifier of a class
Stack(Out) the just created (transient) object

An object is created in transient memory (on the heap) (and the default constructor of the class is called). KEEP ensures that the object is not logged into the garbage collection and therefore exists until it is explicitly logged into the garbage collection via DeleteObject or CX_GARBAGE_MANAGER։։Register and the garbage collection determines that the object is no longer referenced by any variable.

Alternatively, the object can be deleted directly with the command KillObject . Afterwards, however, no more variables may refer to this object, as this would lead to program crashes.