Browse Source

cmState: Avoid accumulating policy stack storage for short-lived scopes

We enforce policy push/pop balance around any scope that pushes/pops a
snapshot.  Therefore a snapshot may never reference entries of
PolicyStack that were created in nested scopes.  Free storage of
short-lived policy stack entries when they are popped.
Brad King 10 years ago
parent
commit
f21dc4a81c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Source/cmState.cxx

+ 1 - 1
Source/cmState.cxx

@@ -1124,7 +1124,7 @@ bool cmState::Snapshot::PopPolicy()
     {
     return false;
     }
-  ++pos->Policies;
+  pos->Policies = this->State->PolicyStack.Pop(pos->Policies);
   return true;
 }