Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 4 - Color QuickDraw / Color QuickDraw Reference
Color QuickDraw Routines / Opening and Closing Color Graphics Ports


The CloseCPort procedure closes a color graphics port. The Window Manager calls this procedure when you close or dispose of a window, and the DisposeGWorld procedure calls it when you dispose of an offscreen graphics world containing a color graphics port.

PROCEDURE CloseCPort (port: CGrafPtr); 
A pointer to a CGrafPort record.
The CloseCPort procedure releases the memory allocated to the CGrafPort record. It disposes of the visRgn, clipRgn, bkPixPat, pnPixPat, fillPixPat, and grafVars handles. It also disposes of the graphics port's pixel map, but it doesn't dispose of the pixel map's color table (which is really owned by the GDevice record). If you have placed your own color table into the pixel map, either dispose of it before calling CloseCPort or store another reference.

The CloseCPort procedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996