From 254be613b803816a918c12d7d7eca40a7c9f7c09 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sun, 21 Jun 2015 19:56:31 +0200 Subject: [PATCH] cmMakefile: Move resource management into the IncludeScope. --- Source/cmMakefile.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 87d6e3c5ac..b02cfc81dc 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -486,6 +486,7 @@ cmMakefile::IncludeScope::~IncludeScope() this->EnforceCMP0011(); } } + this->Makefile->ListFileStack.pop_back(); } //---------------------------------------------------------------------------- @@ -544,16 +545,12 @@ bool cmMakefile::ReadDependentFile(const char* listfile, bool noPolicyScope) { this->AddDefinition("CMAKE_PARENT_LIST_FILE", this->GetDefinition("CMAKE_CURRENT_LIST_FILE")); - bool result = false; - { IncludeScope incScope(this, noPolicyScope); - result = this->ReadListFile(listfile, false); + bool result = this->ReadListFile(listfile, false); if(cmSystemTools::GetFatalErrorOccured()) { incScope.Quiet(); } - } - this->ListFileStack.pop_back(); return result; }