mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 15:36:31 +02:00
IDE, SynEdit: fix memleak in option to have bookmarks restore the scroll pos. Issue #40912
This commit is contained in:
parent
166db6365e
commit
3aae5b8b86
@ -519,13 +519,22 @@ procedure TSynEditBookMark.SetTopLeft(ATop, ALeft: integer);
|
||||
begin
|
||||
if (ATop <= 0) or (ALeft <= 0) then
|
||||
exit;
|
||||
FTopLeftMark := TSynEditTopLeftMark.Create(OwnerEdit);
|
||||
TSynEditTopLeftMark(FTopLeftMark).FBookMark := Self;
|
||||
FTopLeftMark.Line := ATop;
|
||||
FTopLeftMark.Column := ALeft;
|
||||
|
||||
if (FMarkList <> nil) then
|
||||
FMarkList.Add(FTopLeftMark);
|
||||
if FTopLeftMark = nil then begin
|
||||
FTopLeftMark := TSynEditTopLeftMark.Create(OwnerEdit);
|
||||
TSynEditTopLeftMark(FTopLeftMark).FBookMark := Self;
|
||||
|
||||
FTopLeftMark.Line := ATop;
|
||||
FTopLeftMark.Column := ALeft;
|
||||
|
||||
if (FMarkList <> nil) then
|
||||
FMarkList.Add(FTopLeftMark);
|
||||
end
|
||||
else
|
||||
if (FTopLeftMark.Line <> ATop) or (FTopLeftMark.Column <> ALeft) then begin
|
||||
FTopLeftMark.Line := ATop;
|
||||
FTopLeftMark.Column := ALeft;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TSynEditBookMark.TSynEditTopLeftMark }
|
||||
|
Loading…
Reference in New Issue
Block a user