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: Mac OS Runtime Architectures /
Chapter 3 - Programming for the CFM-Based Runtime Architecture / Calling the Code Fragment Manager


Releasing Fragments

To programmatically release fragments from memory, you use the CloseConnection routine. A call to CloseConnection is simply

myErr = CloseConnection(&myID);
where myID is the ID value received when you called the Code Fragment Manager to prepare the fragment. Note that you cannot call CloseConnection using the ID value received when using the FindCFrag option or the ID passed by a fragment's initialization block (when executing an initialization function).

The CloseConnection routine actually releases the closure associated with the ID and decrements the associated reference counts. If any reference counts drop to 0, the Code Fragment Manager releases the associated section, connection, or fragment container.

Note that all import libraries and other fragments that are prepared on behalf of your application (either as part of its normal startup or programmatically by your application) are released by the Code Fragment Manager at application termination; therefore, a library can be prepared and does not have to be released by the application before it terminates.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 MARCH 1997