From baf753e54d73673524de916757e66ef8c485bc0d Mon Sep 17 00:00:00 2001 From: beware Date: Mon, 31 Mar 2008 00:39:51 +0000 Subject: [PATCH] secondlistener-2 git-svn-id: file:///svnroot/lcore/trunk@12 b1de8a11-f9be-4011-bde0-cc7ace90066a --- lsocket.pas | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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; -- 2.30.2