CloseCPort
CloseCPort
Release memory used by an open CGrafPort #include <Quickdraw.h> Color Quickdraw
CGrafPtr whichPort ; pointer to a CGrafPort structure pnPixPat, the fillPixPat, and the grafVars handle of a cGrafPort and
deactivates the port.
whichPort is a pointer to a 108-byte CGrafPort structure.
responsible for deallocating it, e.g.:
Be sure to close the port before disposing of the memory occupied by the
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.