From: beware Date: Mon, 31 Mar 2008 00:39:51 +0000 (+0000) Subject: secondlistener-2 X-Git-Url: http://www.lcore.org/git/lcore.git/commitdiff_plain/baf753e54d73673524de916757e66ef8c485bc0d secondlistener-2 git-svn-id: file:///svnroot/lcore/trunk@12 b1de8a11-f9be-4011-bde0-cc7ace90066a --- diff --git a/lsocket.pas b/lsocket.pas index ffd411f..3b2d918 100755 --- a/lsocket.pas +++ b/lsocket.pas @@ -385,7 +385,12 @@ begin end else begin secondlistener.onsessionAvailable := secondaccepthandler; end; - secondlistener.listen; + try + secondlistener.listen; + except + secondlistener.destroy; + secondlistener := nil; + end; end; {$endif} finally @@ -408,7 +413,10 @@ end; {$ifdef secondlistener} procedure tlsocket.internalclose(error:word); begin - if assigned(secondlistener) then secondlistener.destroy; + if assigned(secondlistener) then begin + secondlistener.destroy; + secondlistener := nil; + end; inherited internalclose(error); end;