Hi,
I've got some memories leak related to TidHTTP when it's waiting for the response of a server after a GET and that the thread is being terminated.
Example :
aThread = class(TThread)
private
FidHTTP :TidHTTP;
FCommand :String;
public
procedure Execute(); override;
constructor Create(aCommand :String); override;
procedure Disconnect;
end;
procedure aThread.Execute();
var response :String;
begin
response := FidHTTP.Get(FCommand);
end;
procedure aThread.Disconnect;
begin
if ((FidHTTP <> nil) and (FidHTTP.Connected)) then FidHTTP.IOHandler.CloseGracefully;
end;
constructor aThread.Create(aCommand :String); override;
begin
FCommand := aCommand;
inherited Create;
end;
I stop the thread with this when the application close :
aThread.Disconnect;
aThread.Terminate;
aThread.Free;
What should I do to solve the memories leaks ?
FastMM4 Log :
13 - 20 bytes: TIdThreadSafeInteger x 1
21 - 36 bytes: EAccessViolation x 1, TIdCriticalSection x 2
181 - 212 bytes: UnicodeString x 1
Thanks :)