Important: The information in this document is obsolete and should not be used for new development.
ReleaseResource
You can use theReleaseResourceprocedure 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,ReleaseResourcereleases 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,
ReleaseResourcedoes nothing, andResErrorreturns the result coderesNotFound. Be aware thatReleaseResourcewon't release a resource whoseresChangedattribute has been set, butResErrorstill returns the result codenoErr.SPECIAL CONSIDERATIONS
TheReleaseResourceprocedure 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 theResErrorfunction 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
ReleaseResourceprocedure, see Listing 1-8 on page 1-23.