From 5f860ebb67e86e0aa407e26ddf79652f73742211 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 24 Nov 2015 15:00:47 -0500 Subject: 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. --- Source/cmListFileCache.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source/cmListFileCache.cxx') 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() -- cgit v1.2.1