H
hhjjhhjj
Unregistered / Unconfirmed
GUEST, unregistred user!
在一个timer触发的以下过程,导致内存一直在涨,大家帮我看看出了什么问题?
procedure TForm1.GetProcesList;
var
Snap: THandle;
Proc: TPROCESSENTRY32;//uses TLHELP32
begin
ListView1.Items.BeginUpdate;
ListView1.Items.Clear;
ListView1.Items.EndUpdate;
Snap := CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS,0);
Proc.dwSize := SizeOf(TProcessEntry32);
Process32First(Snap, Proc);
Repeat
With ListView1.Items.Add Do
Begin
Caption := proc.szExeFile;
End;
Until
(not Process32Next(Snap, Proc));
end;
procedure TForm1.GetProcesList;
var
Snap: THandle;
Proc: TPROCESSENTRY32;//uses TLHELP32
begin
ListView1.Items.BeginUpdate;
ListView1.Items.Clear;
ListView1.Items.EndUpdate;
Snap := CreateToolHelp32SnapShot(TH32CS_SNAPPROCESS,0);
Proc.dwSize := SizeOf(TProcessEntry32);
Process32First(Snap, Proc);
Repeat
With ListView1.Items.Add Do
Begin
Caption := proc.szExeFile;
End;
Until
(not Process32Next(Snap, Proc));
end;