Path: 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 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.