ClosePort
ClosePort
Release memory used by an open GrafPort deactivates the port.
whichPort is is a pointer to a 108-byte GrafPort structure.
If you used NewPtr to allocate memory for the GrafPort itself, you are responsible for deallocating it, e.g.:
Be sure to close the port before disposing of the memory occupied by the
GrafPort structure. Otherwise, the visRgn and clipRgn memory cannot be recovered.