[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

After the device is closed, you must deallocate the I/O request memory.
The exact method you use depends on how you allocated the memory in the
first place.  For AllocMem() you call FreeMem(), for CreateExtIO() you
call DeleteExtIO(), and for CreateIORequest() you call DeleteIORequest().
If you allocated the I/O request memory at compile time, you naturally
have nothing to free.

Finally, you must delete the message port you created.  You delete the
message port by calling DeleteMsgPort() if you used CreateMsgPort(), or
DeletePort() if you used CreatePort().

Here is the checklist for gracefully exiting:

  * Abort any outstanding I/O requests with AbortIO().

  * Wait for the completion of any outstanding or aborted I/O
    requests with WaitIO().

  * Close the device with CloseDevice().

  * Release the I/O request memory with either DeleteIORequest(),
    DeleteExtIO() or FreeMem() (as appropriate).

  * Delete the message port with DeleteMsgPort() or DeletePort().