From: plugwash Date: Thu, 13 Aug 2009 18:50:30 +0000 (+0000) Subject: make dnsasync better handle cleanup of a partially constructed instance X-Git-Url: http://www.lcore.org/git/lcore.git/commitdiff_plain/2f03297fba2a10dbc860018fac7ad07c83b08ce8 make dnsasync better handle cleanup of a partially constructed instance git-svn-id: file:///svnroot/lcore/trunk@56 b1de8a11-f9be-4011-bde0-cc7ace90066a --- 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;