CompuServe Thread

#Message Ports

2 messages in this thread
#51936From: Ariel ButlerFeb 1, 1987 12:50 PM
Bud: If no one's answered your question yet, here's something to consider that might help. After using CreatePort to make up your port, you MUST use DeletePort to get rid of it. Both CreatePort and DeletePort are higher level functions that call the lower level AddPort and RemovePort functions. The CreatePort allocates some DYNAMIC memory for the MsgPort structure that it hands you back a pointer to. Thus, if you use RemovePort to get rid of the port, the corresponding FreeMem call is NOT performed, and you lose that bit of memory. For the complete breakout of what CreatePort and DeletePort do, see appendix B-5 in the RKM Exec book. This should make things more clear. Ariel
#51984From: Bud RetterFeb 1, 1987 4:28 PM
Ariel, Thanks for your reply. It's the first one, and also, I tried a DeletePort() on a public MsgPort and it crashes the system. A port is public when you use a name in CreatePort(). (See page B-5 in ROM Exec book, where a line reads if (name != 0) AddPort ( port) If you thereafter do a DeletePort instead of a RemPort(), bye bye Amiga. Thanks for your reply. Buddy