mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-20 12:19:31 +02:00
SynEdit: Wrapped-view, fix leaks. Remove event-handler and view in Destroy
(cherry picked from commit e331c9fb35
)
This commit is contained in:
parent
2b4decdf35
commit
5ae99331c1
@ -2682,6 +2682,7 @@ var
|
||||
i: integer;
|
||||
p: TList;
|
||||
begin
|
||||
Destroying;
|
||||
{$IFDEF SynCheckPaintLock}
|
||||
if (FPaintLock > 0) then begin
|
||||
debugln(['TCustomSynEdit.Destroy: Paintlock=', FPaintLock, ' FInvalidateRect=', dbgs(FInvalidateRect)]);
|
||||
|
@ -221,6 +221,7 @@ public
|
||||
function CalculateWrapForLine(ALineIdx: IntIdx; AMaxWidth: integer): Integer; inline;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
|
||||
procedure WrapAll; experimental;
|
||||
procedure ValidateAll; experimental;
|
||||
@ -1811,6 +1812,18 @@ begin
|
||||
WrapAll;
|
||||
end;
|
||||
|
||||
destructor TLazSynEditLineWrapPlugin.Destroy;
|
||||
begin
|
||||
if Editor <> nil then begin
|
||||
TSynEdit(Editor).UnRegisterStatusChangedHandler(@DoWidthChanged);
|
||||
if (FLineMapView <> nil) and not (csDestroying in Editor.Componentstate) then begin
|
||||
TSynEdit(Editor).TextViewsManager.RemoveSynTextView(FLineMapView, True);
|
||||
TSynEdit(Editor).Invalidate;
|
||||
end;
|
||||
end;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TLazSynEditLineWrapPlugin.WrapAll;
|
||||
var
|
||||
c: Integer;
|
||||
|
Loading…
Reference in New Issue
Block a user