Important: The information in this document is obsolete and should not be used for new development.
ClosePortprocedure closes a basic graphics port. The Window Manager calls this procedure when you close or dispose of a window, and the
DisposeGWorldprocedure calls it when you dispose of an offscreen graphics world containing a basic graphics port.
PROCEDURE ClosePort (port: GrafPtr);
- A pointer to a
ClosePortprocedure releases the memory occupied by the given graphics port's
clipRgnfields. 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 procedure
DisposePtr(if it was allocated with
NewPtr). When you call the
DisposeWindowprocedure to close or dispose of a window, it calls
DisposePtrfor you. When you use the
CloseWindowprocedure, it calls
ClosePort, but you must call
ClosePortisn't called before a basic graphics port is disposed of, the memory used by the visible region and the clipping region will be unrecoverable.
ClosePortprocedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.
CloseCPortprocedure (described in the chapter "Color QuickDraw") closes a color graphics port. The
DisposeGWorldprocedure is described in the chapter "Offscreen Graphics Worlds" in this book. The
CloseWindowprocedures are described in the chapter "Window Manager" in Inside Macintosh: Macintosh Toolbox Essentials. The
DisposePtrprocedure is described in the chapter "Memory Manager" in Inside Macintosh: Memory.