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 theCloseConnectionroutine. A call toCloseConnectionis simply
myErr = CloseConnection(&myID);wheremyIDis the ID value received when you called the Code Fragment Manager to prepare the fragment. Note that you cannot callCloseConnectionusing the ID value received when using theFindCFragoption or the ID passed by a fragment's initialization block (when executing an initialization function).The
CloseConnectionroutine 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.