- This topic has 1 reply, 2 voices, and was last updated 2 months ago by .
Viewing 1 reply thread
Viewing 1 reply thread
- You must be logged in to reply to this topic.
Home › Forums › kbmMW › Sometime I see AV in destructor TkbmMWCustomTCPIPIndyClientTransport.Destroy;
destructor TkbmMWCustomTCPIPIndyClientTransport.Destroy;
begin
if FSocket<>nil then
begin
try
Disconnect;
except
end;
end;
FSocket.free;
FSocket:=nil;
inherited;
end;
I think it is needed to be changed on
destructor TkbmMWCustomTCPIPIndyClientTransport.Destroy;
begin
if FSocket<>nil then
begin
try
Disconnect;
except
end;
FSocket.free;
FSocket:=nil;
end;
inherited;
end;
Logically, yes. The change certainly is not wrong, and I will implement it.
However free is actually supposed to ignore a null self.
It may more indicate that there is a lingering TkbmMWCustomTCPIPIndyClientTransport instance somewhere that may be attempted to be freed by two threads at the same time?
/KBM