From bd2b087fa74b59e8312a302e73128e02719595e2 Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 13 Jun 2023 09:05:07 +0200 Subject: [PATCH] SourceEditorIntf: New methods to add custom panels to the SourceEditor-Window. --- ide/sourceeditor.pp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ide/sourceeditor.pp b/ide/sourceeditor.pp index 7dde48bf19..9f254231f7 100644 --- a/ide/sourceeditor.pp +++ b/ide/sourceeditor.pp @@ -6678,10 +6678,14 @@ end; destructor TSourceEditorStatusPanel.Destroy; begin - if (FSrcNotebook <> nil) and (FSrcNotebook.FStatusPanels <> nil) then - FSrcNotebook.FStatusPanels.Remove(Self); if OnDestroy <> nil then OnDestroy(Self); + if (FSrcNotebook <> nil) and (FSrcNotebook.FStatusPanels <> nil) then begin + FSrcNotebook.FStatusPanels.FreeObjects := False; + FSrcNotebook.FStatusPanels.Remove(Self); + FSrcNotebook.FStatusPanels.FreeObjects := True; + FreeAndNil(FPanel); + end; inherited Destroy; end;