HI.
I can't understand why Madexcept shows a leak on FIndFirst/FindClose.
THis is what I have :
type
SendThread = class(TThread)
private
CriticalSection: TCriticalSection;
fmods:modslist;
tablename: string;
savedir: string;
dbase: string;
uniq: integer;
public
Constructor Create(afmods:modslist; atablename: string;uniquenumber: int64;asavedir,adbase: string);
Destructor Destroy; override;
procedure Execute; override;
procedure Fields2sTREAM(fmods:modslist; tablename: string; dbase: Tnxdatabase);
end;
CriticalSection is created in the Create constructor and free-d in Destroy.
In the Execute, I have this.
CriticalSection.Acquire;
try
s:=savedir+'\*'+lowercase(dm2.uniquenumber.tablename)+'.db';
if findfirst(s,faAnyFile,sr)=0 then begin
Deletefile(savedir+'\'+sr.name);
FindClose(SR);
end;
s:=Format('%.*d',[13, uniq]);
s:= savedir+'\'+s+'$pos-'+lowercase(dm2.uniquenumber.tablename)+'.db';
sStream.savetofile(s);
finally
CriticalSection.Release;
end;
Any clue anybody?