External Interfaces/API    

Releasing COM Interfaces and Objects

Use these MATLAB functions to release or delete a COM object or interface.

Function
Description
delete
Delete a COM object or interface
release
Release a COM object or interface

When each interface is no longer needed, use the release function to release the interface and reclaim the memory used by it. When the entire control or server is no longer needed, use the delete function to delete it. Alternatively, you can use the delete function on any valid interface. All interfaces for that object are automatically released and the server or control itself is deleted.

MATLAB automatically releases all interfaces for a control when the figure window that contains that control is deleted or closed. MATLAB also automatically releases all handles for an Automation server when MATLAB is shut down.


  Saving Your Work Writing Event Handlers