From 2f03297fba2a10dbc860018fac7ad07c83b08ce8 Mon Sep 17 00:00:00 2001 From: plugwash Date: Thu, 13 Aug 2009 18:50:30 +0000 Subject: [PATCH] make dnsasync better handle cleanup of a partially constructed instance git-svn-id: file:///svnroot/lcore/trunk@56 b1de8a11-f9be-4011-bde0-cc7ace90066a --- dnsasync.pas | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dnsasync.pas b/dnsasync.pas index 8c3ce3a..a8e1aa6 100755 --- a/dnsasync.pas +++ b/dnsasync.pas @@ -100,12 +100,14 @@ var socketno : integer; begin for socketno := 0 to numsock -1 do begin - if dnsserverids[socketno] >= 0 then begin - reportlag(dnsserverids[socketno],-1); - dnsserverids[socketno] := -1; - end; - sockets[socketno].release; - setstate_request_init('',states[socketno]); + if assigned(sockets[socketno]) then begin + if dnsserverids[socketno] >= 0 then begin + reportlag(dnsserverids[socketno],-1); + dnsserverids[socketno] := -1; + end; + sockets[socketno].release; + setstate_request_init('',states[socketno]); + end; end; inherited destroy; end; -- 2.30.2