diff options
author | Brad King <brad.king@kitware.com> | 2009-01-20 19:36:18 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-01-20 19:36:18 (GMT) |
commit | 2c81e5fb5cd592e9450250364e6667082014f0b7 (patch) | |
tree | 8897bcaca936aaedba35f3153f976b315b912329 /Source/cmMakefile.cxx | |
parent | a541cac325715cd50f604ede864eba8edfbb2673 (diff) | |
download | CMake-2c81e5fb5cd592e9450250364e6667082014f0b7.zip CMake-2c81e5fb5cd592e9450250364e6667082014f0b7.tar.gz CMake-2c81e5fb5cd592e9450250364e6667082014f0b7.tar.bz2 |
ENH: Refactor function blocker deletion
When a function blocker decides to remove itself we previously removed
it at every return point from the C++ scope in which its removal is
needed. This teaches function blockers to transfer ownership of
themselves from cmMakefile to an automatic variable for deletion on
return. Since this removes blockers before they replay their commands,
we no longer need to avoid running blockers on their own commands.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index bc013f9..ed70c07 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2395,7 +2395,8 @@ bool cmMakefile::ExpandArguments( return !cmSystemTools::GetFatalErrorOccured(); } -void cmMakefile::RemoveFunctionBlocker(const cmListFileFunction& lff) +cmsys::auto_ptr<cmFunctionBlocker> +cmMakefile::RemoveFunctionBlocker(const cmListFileFunction& lff) { // loop over all function blockers to see if any block this command std::list<cmFunctionBlocker *>::reverse_iterator pos; @@ -2406,12 +2407,11 @@ void cmMakefile::RemoveFunctionBlocker(const cmListFileFunction& lff) { cmFunctionBlocker* b = *pos; this->FunctionBlockers.remove(b); - delete b; - break; + return cmsys::auto_ptr<cmFunctionBlocker>(b); } } - return; + return cmsys::auto_ptr<cmFunctionBlocker>(); } void cmMakefile::SetHomeDirectory(const char* dir) |