ide: fix a memory leak I made in TSourceEditor.OnGutterClick

git-svn-id: trunk@18964 -
This commit is contained in:
paul 2009-03-12 03:39:56 +00:00
parent 0ecf4167d0
commit 09b40cf1b1

View File

@ -2088,21 +2088,26 @@ var
begin begin
// create or delete breakpoint // create or delete breakpoint
// find breakpoint mark at line // find breakpoint mark at line
SourceEditorMarks.GetMarksForLine(FEditor, Line, Marks, MarkCount); Marks := nil;
BreakFound := False; try
ExecutionFound := False; SourceEditorMarks.GetMarksForLine(FEditor, Line, Marks, MarkCount);
for i := 0 to MarkCount - 1 do BreakFound := False;
begin ExecutionFound := False;
if not Marks[i].Visible then for i := 0 to MarkCount - 1 do
Continue;
if Marks[i].IsBreakPoint then
begin begin
BreakFound := True; if not Marks[i].Visible then
DebugBoss.DoDeleteBreakPointAtMark(Marks[i]) Continue;
end if Marks[i].IsBreakPoint then
else begin
if Marks[i] = FExecutionMark then BreakFound := True;
ExecutionFound := True; DebugBoss.DoDeleteBreakPointAtMark(Marks[i])
end
else
if Marks[i] = FExecutionMark then
ExecutionFound := True;
end;
finally
FreeMem(Marks);
end; end;
if not BreakFound then if not BreakFound then