From: shulick@navajo.ucs.indiana.edu (Sam Hulick)
Subject: MEMORY LEAK FIXED
Originator: shulick@navajo
Reply-To: shulick@navajo.ucs.indiana.edu
Organization: Vallen Software
Date: Fri, 8 Jan 1993 19:26:10 GMT


Ok!  let me explain how I fixed it.
Let's say you run "server", it goes up.  Ok.. this is 'server1', we'll
call it.  So you try to shut it down by typing "server" again.. we'll
call this proc 'server2'.  Currently, server1 is at WaitPort(), waiting
for a message.  server2 runs, finds itself already running, and tries to
DeleteMsgPort(), RemPort(), etc.  Well, server1's port is now off the
port list, but it's still at a WaitPort().  So the server, in actuality,
was never shut down.  I figured this out by compiling the server to NOT
run in the background, and noticed it was still running after I had
"shut it down".  (thanks, mlel!)  Below is the complete source, server.c
(the server), foomsg.h, and send.c (to send messages to the port).  The
server can be shut down with either "server" ( a 2nd time) or "send
*shutdown".  Thanks for your time & effort.  If you find any more
possible bugs or things like that, let me know.  =u)

-------snip---------
begin 600 server.lha
M'@$M;&@U+3L```!#````*J\D&@``"&9O;VUS9RYH\>\`+TM2C3@H]X`^8@X*
MCH:5I@++&5!L9&N"TW&]B@L9QZN1.]Z5B$:I?$`.-PP\,>F6R8#[3OJ7AE^9
M`!R1+6QH-2TR`0``$@(``/4&)1H```9S96YD+F,:4@$Z8IK9MK1'GG@!]T02
M6E+EYM^O)0>#!E%XE1+9?KK`;?J22UV$WANETN!1X?Z@$C2<URBAI$''BU9!
M9UE,#M%1\9P*S"7%?6/'T\/-(>8=;B^$;ZO#[8%2;D39Q+K0CJ9>OYQK(?YS
MZV'/;W_D(N!+UYZ?^-@;7N_HZ_EE7,=\8--Y_TU-AG<[?/:E"'/;BMXH,]I.
M=3O(1F;$(R-E8NI9>IE[Q2N8+MI:)9:<I$?:`!H<VNW[H4$);N.=%0-1EKPX
MJT:KHKDPIR]>WWDV9@:#;4RM4>C+`K4J*`.X4,OKS4U)A3-5+=29)),P_-WA
MEF#84K8J'E1-;,$^6/[ZB+&-<^?VO3%>AA<&/5V1[<L]-V+X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bloody likely.  I am going in a
 \/                     / taxi."  --George Bernard Shaw