Main Content

releaseImpl

Class: matlab.System

Release resources

Syntax

releaseImpl(obj)

Description

releaseImpl(obj) releases any resources used by the System object™, such as file handles or devices. This method also performs any necessary cleanup tasks. To release resources for a System object, you must use releaseImpl instead of a destructor.

Run-Time Details

releaseImpl is called by the release method. releaseImpl is also called when the object is deleted or cleared from memory, or when all references to the object have gone out of scope. For details, see Detailed Call Sequence.

Method Authoring Tips

You must set Access = protected for this method.

Input Arguments

expand all

System object handle used to access properties, states, and methods specific to the object. If your releaseImpl method does not use the object, you can replace this input with ~.

Examples

expand all

Use the releaseImpl method to close a file opened by the System object.

methods (Access = protected)
   function releaseImpl(obj)
     fclose(obj.pFileID);
   end
end

Version History

Introduced in R2011b