secondlistener-2
authorbeware <beware@bircd.org>
Mon, 31 Mar 2008 00:39:51 +0000 (00:39 +0000)
committerbeware <beware@bircd.org>
Mon, 31 Mar 2008 00:39:51 +0000 (00:39 +0000)
git-svn-id: file:///svnroot/lcore/trunk@12 b1de8a11-f9be-4011-bde0-cc7ace90066a

lsocket.pas

index ffd411f6b743ed99cb8fc5b3149d13d0c7a903e2..3b2d918583aeb1dffdae709c9061a6690fdfa248 100755 (executable)
@@ -385,7 +385,12 @@ begin
       end else begin\r
         secondlistener.onsessionAvailable := secondaccepthandler;\r
       end;\r
       end else begin\r
         secondlistener.onsessionAvailable := secondaccepthandler;\r
       end;\r
-      secondlistener.listen;\r
+      try\r
+        secondlistener.listen;\r
+      except\r
+        secondlistener.destroy;\r
+        secondlistener := nil;\r
+      end;\r
     end;\r
     {$endif}\r
   finally\r
     end;\r
     {$endif}\r
   finally\r
@@ -408,7 +413,10 @@ end;
 {$ifdef secondlistener}\r
 procedure tlsocket.internalclose(error:word);\r
 begin\r
 {$ifdef secondlistener}\r
 procedure tlsocket.internalclose(error:word);\r
 begin\r
-  if assigned(secondlistener) then secondlistener.destroy;\r
+  if assigned(secondlistener) then begin\r
+    secondlistener.destroy;\r
+    secondlistener := nil;\r
+  end;\r
   inherited internalclose(error);\r
 end;\r
 \r
   inherited internalclose(error);\r
 end;\r
 \r