IDL_IDLBridge::Cleanup
Syntax | Arguments | Keywords | Examples | Version History
The IDL_IDLBridge::Cleanup procedure method performs all cleanup when the bridge object is destroyed.
Note
Cleanup methods are special life cycle methods, and as such cannot be called outside the context of object destruction. This means that in most cases you cannot call the Cleanup method directly. There is one exception to this rule: if you write your own subclass of this class, you can call the Cleanup method from within the Cleanup method of the subclass.
A program should ensure that a child process executing a command asynchronously has been completed or aborted before the associated IDL_IDLBridge object is destroyed. If you have started a process by calling the IDL_IDLBridge::Execute method with the NOWAIT keyword, you may want to wait for the process to become idle before destroying the bridge object.
When you call Cleanup, the following steps will occur:
- If there is a currently executing asynchronous command, then IDL_IDLBridge::Abort is called
- If there is a pending callback, then the IDL_IDLBridge::OnCallback method (and the CALLBACK procedure) is called
- The child IDL process is destroyed
Syntax
OBJ_DESTROY, Obj
or
Obj->[IDL_IDLBridge::]Cleanup (In a lifecycle method only.)
Arguments
None.
Keywords
None.
Examples
Ideally, a program should not destroy an IDL_IDLBridge object while an asynchronous command is busy. However, a cleanup method for child process that executes commands asynchronously should still include code to ensure an executing process is aborted or completed before it is destroyed.
For an IDL_IDLBridge object named oIDLBridge, use the following code to abort an executing process:
If you prefer to wait for the process to reach an idle state before destroying the bridge object, you can use code similar to the following:
WHILE (oIDLBridge->Status() NE 0) DO WAIT, 0.5 OBJ_DESTROY, oIDLBridgeNote
The IDL_IDLBridge::Status method returns status information for child processes executing commands asynchronously. A child process executing a command synchronously will only return a value of 0 (idle).
Version History