summaryrefslogtreecommitdiffstats
path: root/Source/cmListFileCache.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-11-24 20:00:47 (GMT)
committerBrad King <brad.king@kitware.com>2015-11-25 17:30:13 (GMT)
commit5f860ebb67e86e0aa407e26ddf79652f73742211 (patch)
tree3b70c951a78cb2c13c92ef6d66b996e1f38ae534 /Source/cmListFileCache.cxx
parentf21dc4a81c05c79b873c9918f6fe8aff4bf02133 (diff)
downloadCMake-5f860ebb67e86e0aa407e26ddf79652f73742211.zip
CMake-5f860ebb67e86e0aa407e26ddf79652f73742211.tar.gz
CMake-5f860ebb67e86e0aa407e26ddf79652f73742211.tar.bz2
cmState: Avoid accumulating snapshot storage for short-lived scopes
We need to keep only certain snapshot types and their ancestors. Also keep those needed for backtraces.
Diffstat (limited to 'Source/cmListFileCache.cxx')
-rw-r--r--Source/cmListFileCache.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 676074f..1465f90 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -403,6 +403,10 @@ cmListFileBacktrace::cmListFileBacktrace(cmState::Snapshot snapshot,
: Context(cc)
, Snapshot(snapshot)
{
+ if (this->Snapshot.IsValid())
+ {
+ this->Snapshot.Keep();
+ }
}
cmListFileBacktrace::~cmListFileBacktrace()