From 76c236ce4eed8c737e3b720fc5ea5b61b90a3e1b Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Tue, 11 Nov 2014 05:41:27 +0100 Subject: [PATCH] fixed possible future bugs when multiple project will be implemented --- src/ce_cdbcmd.pas | 3 ++- src/ce_editor.pas | 5 ++++- src/ce_projconf.pas | 5 +++++ src/ce_projinspect.pas | 5 ++++- src/ce_staticexplorer.pas | 3 ++- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/ce_cdbcmd.pas b/src/ce_cdbcmd.pas index a2b24eec..6bedbfdf 100644 --- a/src/ce_cdbcmd.pas +++ b/src/ce_cdbcmd.pas @@ -79,6 +79,8 @@ end; procedure TCECdbWidget.projClosing(const aProject: TCEProject); begin + if fProject <> aProject then + exit; fProject := nil; end; @@ -89,7 +91,6 @@ end; procedure TCECdbWidget.projChanged(const aProject: TCEProject); begin - fProject := aProject; end; {$ENDREGION --------------------------------------------------------------------} diff --git a/src/ce_editor.pas b/src/ce_editor.pas index 348aaaff..4a2f352f 100644 --- a/src/ce_editor.pas +++ b/src/ce_editor.pas @@ -148,7 +148,8 @@ end; procedure TCEEditorWidget.projClosing(const aProject: TCEProject); begin - if fProj <> aProject then exit; + if fProj <> aProject then + exit; fProj := nil; end; @@ -159,6 +160,8 @@ end; procedure TCEEditorWidget.projChanged(const aProject: TCEProject); begin + if fProj <> aProject then + exit; fProj := aProject; end; diff --git a/src/ce_projconf.pas b/src/ce_projconf.pas index c89e956f..882a4bbd 100644 --- a/src/ce_projconf.pas +++ b/src/ce_projconf.pas @@ -70,13 +70,18 @@ end; procedure TCEProjectConfigurationWidget.projClosing(const aProject: TCEProject); begin + if fProj <> aProject then + exit; Grid.TIObject := nil; Grid.ItemIndex := -1; + self.selConf.Clear; fProj := nil; end; procedure TCEProjectConfigurationWidget.projChanged(const aProject: TCEProject); begin + if fProj <> aProject then + exit; beginUpdateByEvent; fProj := aProject; endUpdateByEvent; diff --git a/src/ce_projinspect.pas b/src/ce_projinspect.pas index 633dba73..24c4f675 100644 --- a/src/ce_projinspect.pas +++ b/src/ce_projinspect.pas @@ -129,6 +129,8 @@ end; procedure TCEProjectInspectWidget.projClosing(const aProject: TCEProject); begin + if fProject <> aProject then + exit; fProject := nil; UpdateByEvent; end; @@ -141,7 +143,8 @@ end; procedure TCEProjectInspectWidget.projChanged(const aProject: TCEProject); begin - fProject := aProject; + if fProject <> aProject then + exit; UpdateByEvent; end; {$ENDREGION} diff --git a/src/ce_staticexplorer.pas b/src/ce_staticexplorer.pas index e878d81e..9299b396 100644 --- a/src/ce_staticexplorer.pas +++ b/src/ce_staticexplorer.pas @@ -266,6 +266,8 @@ end; procedure TCEStaticExplorerWidget.projClosing(const aProject: TCEProject); begin + if fProj <> aProject then + exit; fProj := nil; end; @@ -276,7 +278,6 @@ end; procedure TCEStaticExplorerWidget.projChanged(const aProject: TCEProject); begin - fProj := aProject; end; {$ENDREGION}