DisposeHandle
When you are completely done with a relocatable block, call the DisposeHandle procedure to free it and its master pointer for other uses.
PROCEDURE DisposeHandle (h: Handle);
h
- A handle to a relocatable block.
DESCRIPTION
The DisposeHandle procedure releases the memory occupied by the relocatable block whose handle is h. It also frees the handle's master pointer for other uses.
- WARNING
- After a call to
DisposeHandle, all handles to the released block become invalid and should not be used again. Any subsequent calls to DisposeHandle using an invalid handle might damage the master pointer list.
Do not use DisposeHandle to dispose of a handle obtained from the Resource Manager (for example, by a previous call to GetResource); use ReleaseResource instead. If, however, you have called DetachResource on a resource handle, you should dispose of the storage by calling DisposeHandle.
SPECIAL CONSIDERATIONS
Because DisposeHandle purges memory, you should not call it at interrupt time.
ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for DisposeHandle are
| Registers on entry |
| A0 | Handle to the relocatable block to be disposed of |
| Registers on exit |
| D0 | Result code |
RESULT CODES
| noErr | 0 | No error |
| memWZErr | -111 | Attempt to operate on a free block |