Important: The information in this document is obsolete and should not be used for new development.
ClosePort
TheClosePort
procedure closes a basic graphics port. The Window Manager calls this procedure when you close or dispose of a window, and theDisposeGWorld
procedure calls it when you dispose of an offscreen graphics world containing a basic graphics port.
PROCEDURE ClosePort (port: GrafPtr);
port
- A pointer to a
GrafPort
record.DESCRIPTION
TheClosePort
procedure releases the memory occupied by the given graphics port'svisRgn
andclipRgn
fields. When you're completely through with a basic graphics port, you can use this procedure and then dispose of the graphics port with the Memory Manager procedureDisposePtr
(if it was allocated withNewPtr
). When you call theDisposeWindow
procedure to close or dispose of a window, it callsClosePort
andDisposePtr
for you. When you use theCloseWindow
procedure, it callsClosePort
, but you must callDisposePtr
.SPECIAL CONSIDERATIONS
IfClosePort
isn't called before a basic graphics port is disposed of, the memory used by the visible region and the clipping region will be unrecoverable.The
ClosePort
procedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.SEE ALSO
TheCloseCPort
procedure (described in the chapter "Color QuickDraw") closes a color graphics port. TheDisposeGWorld
procedure is described in the chapter "Offscreen Graphics Worlds" in this book. TheDisposeWindow
andCloseWindow
procedures are described in the chapter "Window Manager" in Inside Macintosh: Macintosh Toolbox Essentials. TheDisposePtr
procedure is described in the chapter "Memory Manager" in Inside Macintosh: Memory.