mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 16:31:40 +02:00
IDE: fixed memleak in the export of the todo list from Stephano (bug #11188)
git-svn-id: trunk@14952 -
This commit is contained in:
parent
dd8ebeaf31
commit
d72daa659b
@ -491,23 +491,26 @@ begin
|
||||
if SaveDialog1.Execute then
|
||||
begin
|
||||
CommaList:=TStringList.Create;
|
||||
CommaList.Add('Done,Description,Priority,Module,Line,Owner,Category');
|
||||
i:=0;
|
||||
while i<lvTodo.Items.Count do
|
||||
begin
|
||||
todoItm:=TTodoItem(lvTodo.Items[i].Data);
|
||||
if todoItm.Done then s:='X,' else s:=' ,';
|
||||
t:=DelChars(todoItm.Text,',');{Strip any commas that can cause a faulty csv file}
|
||||
s:=s+t+','+IntToStr(todoItm.Priority)+','+todoItm.Filename+
|
||||
','+IntToStr(todoItm.LineNumber)+','+todoItm.Owner+','+todoItm.Category;
|
||||
CommaList.Add(s);
|
||||
i:=i+1;
|
||||
try
|
||||
CommaList.Add('Done,Description,Priority,Module,Line,Owner,Category');
|
||||
i:=0;
|
||||
while i<lvTodo.Items.Count do
|
||||
begin
|
||||
todoItm:=TTodoItem(lvTodo.Items[i].Data);
|
||||
if todoItm.Done then s:='X,' else s:=' ,';
|
||||
t:=DelChars(todoItm.Text,',');{Strip any commas that can cause a faulty csv file}
|
||||
s:=s+t+','+IntToStr(todoItm.Priority)+','+todoItm.Filename+
|
||||
','+IntToStr(todoItm.LineNumber)+','+todoItm.Owner+','+todoItm.Category;
|
||||
CommaList.Add(s);
|
||||
i:=i+1;
|
||||
end;
|
||||
CommaList.SaveToFile(SaveDialog1.FileName);
|
||||
finally
|
||||
CommaList.Clear;
|
||||
CommaList.Free;
|
||||
end;
|
||||
CommaList.SaveToFile(SaveDialog1.FileName);
|
||||
end
|
||||
else MessageDlg('Warning','Filename is: '+SaveDialog1.FileName,mtWarning,[mbClose],0);
|
||||
CommaList.Clear;
|
||||
CommaList.Free;
|
||||
end;
|
||||
|
||||
procedure TfrmTodo.acRefreshExecute(Sender: TObject);
|
||||
|
Loading…
Reference in New Issue
Block a user