Important: The information in this document is obsolete and should not be used for new development.
Releasing Fragments
To programmatically release fragments from memory, you use theCloseConnection
routine. A call toCloseConnection
is simply
myErr = CloseConnection(&myID);wheremyID
is the ID value received when you called the Code Fragment Manager to prepare the fragment. Note that you cannot callCloseConnection
using the ID value received when using theFindCFrag
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.