mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 10:50:16 -06:00
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.
This commit is contained in:
@@ -1124,7 +1124,7 @@ bool cmState::Snapshot::PopPolicy()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
++pos->Policies;
|
||||
pos->Policies = this->State->PolicyStack.Pop(pos->Policies);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user