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: Text /
Chapter 2 - TextEdit / TextEdit Reference
Routines / Initializing TextEdit, Creating an Edit Record, and Disposing of an Edit Record


TEDispose

The TEDispose procedure removes a specified edit record and releases all memory associated with it.

PROCEDURE TEDispose (hTE: TEHandle); 
hTE
A handle to the edit record for which the allocated memory should be released.
DESCRIPTION
Call the TEDispose procedure only when you're completely through with an
edit record.

Note that if your program retains a handle to text associated with the edit record that you are destroying with TEDispose, the handle becomes invalid because the TEDispose procedure disposes of it, as well as the dispatch record handle. If the record is multistyled, TEDispose also disposes all of the style-related handles: STHandle, LHHandle, STScrpHandle, nullSTHandle, and TEStyleHandle.

To continue to refer to the text after you've destroyed the edit record, you need to make a copy of the handle in the hText field of the edit record using the Operating System Utilities HandToHand function before you call TEDispose. (See Inside Macintosh: Operating System Utilities for more information.)

In addition to disposing of the edit record, the edit record handle, and the dispatch record handle, the TEDispose procedure destroys the null scrap associated with the edit record and releases the memory used for it.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996