DESTROY
7.8.5, PLBCMP GUI Only
The DESTROY instruction removes an item from the screen and release the data structures obtained for an object during a CREATE instruction. The instruction uses the following format:
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A previously defined and created object or a pointer to an object that is destroyed.
Flags Affected: NONE
Note the following:
DESTROY is valid for all object variable types.
If the object is currently active, it is deactivated prior to the actual destroy operation.
All data structures used by the object are released.
An attempt to DESTROY an object before it has been CREATEd results in the instruction being ignored.
When a 'DESTROY PLBOBJECT' statement is executed, the PL/B runtime invokes/executes the 'ClassDestroy' FUNCTION in the CLASSMODULE associated with the PLBOBJECT object. The 'ClassDestroy' function is not executed when a PLBOBJECT object is destroyed implicitly during a CREATE, STOP or SHUTDOWN operation. The 'DESTROY PLBOBJECT' operation unloads and frees memory for the CLASSMODULE created for the PLBOBJECT.
See Also: Example Code, CREATE, Object Instructions
![]() |