From 0d8dceea4310fde5706b3ce1c70609d72a38efdf Mon Sep 17 00:00:00 2001 From: John Schoenick Date: Wed, 9 Sep 2015 18:35:41 -0700 Subject: Updated the SDK with the latest code from the TF and HL2 branches. --- mp/src/public/tier1/utlrbtree.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mp/src/public/tier1/utlrbtree.h') diff --git a/mp/src/public/tier1/utlrbtree.h b/mp/src/public/tier1/utlrbtree.h index 273ee958..ded22bf5 100644 --- a/mp/src/public/tier1/utlrbtree.h +++ b/mp/src/public/tier1/utlrbtree.h @@ -1150,6 +1150,11 @@ void CUtlRBTree::RemoveAll() // Clear everything else out m_Root = InvalidIndex(); + // Technically, this iterator could become invalid. It will not, because it's + // always the same iterator. If we don't clear this here, the state of this + // container will be invalid after we start inserting elements again. + m_LastAlloc = m_Elements.InvalidIterator(); + m_FirstFree = InvalidIndex(); m_NumElements = 0; Assert( IsValid() ); @@ -1163,9 +1168,7 @@ template < class T, class I, typename L, class M > void CUtlRBTree::Purge() { RemoveAll(); - m_FirstFree = InvalidIndex(); m_Elements.Purge(); - m_LastAlloc = m_Elements.InvalidIterator(); } -- cgit v1.2.3