mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-15 05:42:37 +02:00
ide: fix a memory leak I made in TSourceEditor.OnGutterClick
git-svn-id: trunk@18964 -
This commit is contained in:
parent
0ecf4167d0
commit
09b40cf1b1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user