summaryrefslogtreecommitdiff
path: root/Source/cmListFileCache.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-11-24 15:00:47 -0500
committerBrad King <brad.king@kitware.com>2015-11-25 12:30:13 -0500
commit5f860ebb67e86e0aa407e26ddf79652f73742211 (patch)
tree3b70c951a78cb2c13c92ef6d66b996e1f38ae534 /Source/cmListFileCache.cxx
parentf21dc4a81c05c79b873c9918f6fe8aff4bf02133 (diff)
downloadcmake-5f860ebb67e86e0aa407e26ddf79652f73742211.tar.gz
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 676074fddb..1465f907be 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()