* Explicitly release MiniMap

This commit is contained in:
Michaël Van Canneyt 2024-09-29 13:34:40 +02:00
parent d7bacb390f
commit ae17b60288

View File

@ -49,6 +49,7 @@ type
procedure SetViewWindowTextColor(AValue: TColor);
protected
procedure NewEditorCreated(Sender: TObject);
procedure EditorDestroyed(Sender: TObject);
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure ConfigPanel(aPanel: TMiniMapControl; aFull: Boolean = False);
Property MiniMaps[aIndex : Integer] : TMiniMapControl Read GetMiniMap;
@ -91,6 +92,7 @@ begin
SourceEditorManagerIntf.RegisterChangeEvent(semEditorMoved,@NewEditorCreated);
SourceEditorManagerIntf.RegisterChangeEvent(semEditorCloned,@NewEditorCreated);
SourceEditorManagerIntf.RegisterChangeEvent(semEditorReConfigured,@EditorReconfigured);
SourceEditorManagerIntf.RegisterChangeEvent(semEditorDestroy,@EditorDestroyed);
end
else
begin
@ -98,6 +100,7 @@ begin
SourceEditorManagerIntf.UnRegisterChangeEvent(semEditorMoved,@NewEditorCreated);
SourceEditorManagerIntf.UnRegisterChangeEvent(semEditorCloned,@NewEditorCreated);
SourceEditorManagerIntf.UnRegisterChangeEvent(semEditorReConfigured,@EditorReconfigured);
SourceEditorManagerIntf.UnRegisterChangeEvent(semEditorDestroy,@EditorDestroyed);
end;
end;
@ -201,6 +204,16 @@ begin
EditorWindow.AddControlToEditor(Editor,Panel,Aligns[AlignLeft]);
end;
procedure TMinimapController.EditorDestroyed(Sender: TObject);
var
Editor : TSourceEditorInterface absolute Sender;
Map : TMiniMapControl;
begin
Map:=FindMiniMapForEditor(Editor);
if Assigned(Map) then
Application.ReleaseComponent(Map);
end;
procedure TMinimapController.Notification(AComponent: TComponent;
Operation: TOperation);
begin