SynEdit: fixed access to freed object (FLineMapView will be destroyed, but before it may access the plugin)

This commit is contained in:
Martin 2025-04-22 18:24:45 +02:00
parent 2fc5a52c9a
commit 33a06985b9

View File

@ -1047,7 +1047,7 @@ begin
if Editor <> nil then begin
TSynEdit(Editor).UnRegisterStatusChangedHandler(@DoWidthChanged);
TSynEdit(Editor).UnRegisterStatusChangedHandler(@DoHandleCreated);
if (FLineMapView <> nil) and not (csDestroying in Editor.Componentstate) then begin
if (FLineMapView <> nil) then begin
TSynEdit(Editor).TextViewsManager.RemoveSynTextView(FLineMapView, True);
TSynEdit(Editor).Invalidate;
end;