Article View: comp.sys.amiga.tech
Article #10684How to close a device
From: Leonard Norrgard
Date: Thu, 22 Dec 1988 00:51
Date: Thu, 22 Dec 1988 00:51
18 lines
942 bytes
942 bytes
What is the *correct* order to close a device and free buffer memory &
replyports?
The RKM examples does this in several ways, but my cautious mind says that
one should *first* close the device to prevent access to buffers etc, *then*
free the buffers. It looks like the RKM examples would work in 99% of the
cases...
Currently, I'm doing this (where ReadRequest is a struct IOExtSer *):
if (ReadRequest) {
CloseDevice(ReadRequest);
DeletePort(ReadRequest->IOSer.io_Message.mn_ReplyPort);
FreeMem(ReadRequest, sizeof(*ReadRequest));
}
--
Leonard Norrgaard, vinsci@abo.fi, vinsci@finabo.bitnet, +358-21-654474, EET.
Technical Details
Message-ID:
<587@abo.fi>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!enea!kth!draken!tut!abo.fi!vinsciShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!enea!kth!draken!tut!abo.fi!vinsci From: vinsci@abo.fi (Leonard Norrgard) Newsgroups: comp.sys.amiga.tech Subject: How to close a device Message-ID: <587@abo.fi> Date: 22 Dec 88 00:51:57 GMT Organization: Abo Academy, Finland Lines: 18