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
// create or delete breakpoint
// find breakpoint mark at line
SourceEditorMarks.GetMarksForLine(FEditor, Line, Marks, MarkCount);
BreakFound := False;
ExecutionFound := False;
for i := 0 to MarkCount - 1 do
begin
if not Marks[i].Visible then
Continue;
if Marks[i].IsBreakPoint then
Marks := nil;
try
SourceEditorMarks.GetMarksForLine(FEditor, Line, Marks, MarkCount);
BreakFound := False;
ExecutionFound := False;
for i := 0 to MarkCount - 1 do
begin
BreakFound := True;
DebugBoss.DoDeleteBreakPointAtMark(Marks[i])
end
else
if Marks[i] = FExecutionMark then
ExecutionFound := True;
if not Marks[i].Visible then
Continue;
if Marks[i].IsBreakPoint then
begin
BreakFound := True;
DebugBoss.DoDeleteBreakPointAtMark(Marks[i])
end
else
if Marks[i] = FExecutionMark then
ExecutionFound := True;
end;
finally
FreeMem(Marks);
end;
if not BreakFound then