CloseCPort
CloseCPort Release memory used by an open CGrafPort
#include <Quickdraw.h> Color Quickdraw
void CloseCPort(whichPort );
CGrafPtr whichPort ; pointer to a CGrafPort structure
CloseCPort releases memory used in the visRgn, clipRgn, the bkPixPat, the
pnPixPat, the fillPixPat, and the grafVars handle of a cGrafPort and
deactivates the port.
whichPort is a pointer to a 108-byte CGrafPort structure.
Returns: none

Notes: CloseCPort is seldom used since the Window Manager CloseWindow and
DisposeWindow functions do it automatically.
If you used NewPtr to allocate memory for the CGrafPort itself, you are
responsible for deallocating it, e.g.:
CloseCPort( whichPort );
DisposPtr( ( Ptr ) whichPort );
Be sure to close the port before disposing of the memory occupied by the
CGrafPort structure. Otherwise, the visRgn, the clipRgn, the bkPixPat,
the pnPixPat, the fillPixPat, and the grafVars handle memory cannot be
recovered. CloseCPort removes the portPixMap but not its color table
since that's really owned by the gDevice. If the portPixMap is holding your
own color table, store another reference to it or deallocate it, as above,
before closing the port.