Important: The information in this document is obsolete and should not be used for new development.
ReleaseResource
You can use theReleaseResource
procedure to release the memory a resource occupies when you have finished using it.
PROCEDURE ReleaseResource (theResource: Handle);
theResource
- A handle to a resource.
DESCRIPTION
Given a handle to a resource,ReleaseResource
releases the memory occupied by the resource data, if any, and sets the master pointer of the resource's handle in the resource map in memory toNIL
. If your application previously obtained a handle to that resource, the handle is no longer valid. If your application subsequently calls the Resource Manager to get the released resource, the Resource Manager assigns a new handle.If the given resource isn't a handle to a resource,
ReleaseResource
does nothing, andResError
returns the result coderesNotFound
. Be aware thatReleaseResource
won't release a resource whoseresChanged
attribute has been set, butResError
still returns the result codenoErr
.SPECIAL CONSIDERATIONS
TheReleaseResource
procedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.RESULT CODES
noErr 0 No error resNotFound -192 Resource not found SEE ALSO
To check for errors, call theResError
function as described on page 1-47.For more information about releasing resources, see "Releasing and Detaching Resources" beginning on page 1-17. For an example of the use of the
ReleaseResource
procedure, see Listing 1-8 on page 1-23.