mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 20:39:25 +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
|
begin
|
||||||
if (ATop <= 0) or (ALeft <= 0) then
|
if (ATop <= 0) or (ALeft <= 0) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
|
if FTopLeftMark = nil then begin
|
||||||
FTopLeftMark := TSynEditTopLeftMark.Create(OwnerEdit);
|
FTopLeftMark := TSynEditTopLeftMark.Create(OwnerEdit);
|
||||||
TSynEditTopLeftMark(FTopLeftMark).FBookMark := Self;
|
TSynEditTopLeftMark(FTopLeftMark).FBookMark := Self;
|
||||||
|
|
||||||
FTopLeftMark.Line := ATop;
|
FTopLeftMark.Line := ATop;
|
||||||
FTopLeftMark.Column := ALeft;
|
FTopLeftMark.Column := ALeft;
|
||||||
|
|
||||||
if (FMarkList <> nil) then
|
if (FMarkList <> nil) then
|
||||||
FMarkList.Add(FTopLeftMark);
|
FMarkList.Add(FTopLeftMark);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if (FTopLeftMark.Line <> ATop) or (FTopLeftMark.Column <> ALeft) then begin
|
||||||
|
FTopLeftMark.Line := ATop;
|
||||||
|
FTopLeftMark.Column := ALeft;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSynEditBookMark.TSynEditTopLeftMark }
|
{ TSynEditBookMark.TSynEditTopLeftMark }
|
||||||
|
Loading…
Reference in New Issue
Block a user