aboutsummaryrefslogtreecommitdiff
path: root/mp/src/public/tier1/utlrbtree.h
diff options
context:
space:
mode:
authorJohn Schoenick <[email protected]>2015-09-09 18:35:41 -0700
committerJohn Schoenick <[email protected]>2015-09-09 18:35:41 -0700
commit0d8dceea4310fde5706b3ce1c70609d72a38efdf (patch)
treec831ef32c2c801a5c5a80401736b52c7b5a528ec /mp/src/public/tier1/utlrbtree.h
parentUpdated the SDK with the latest code from the TF and HL2 branches. (diff)
downloadsource-sdk-2013-master.tar.xz
source-sdk-2013-master.zip
Updated the SDK with the latest code from the TF and HL2 branches.HEADmaster
Diffstat (limited to 'mp/src/public/tier1/utlrbtree.h')
-rw-r--r--mp/src/public/tier1/utlrbtree.h7
1 files changed, 5 insertions, 2 deletions
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<T, I, L, M>::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<T, I, L, M>::Purge()
{
RemoveAll();
- m_FirstFree = InvalidIndex();
m_Elements.Purge();
- m_LastAlloc = m_Elements.InvalidIterator();
}