diff options
| author | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
|---|---|---|
| committer | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
| commit | 0d8dceea4310fde5706b3ce1c70609d72a38efdf (patch) | |
| tree | c831ef32c2c801a5c5a80401736b52c7b5a528ec /mp/src/public/tier1/utlrbtree.h | |
| parent | Updated the SDK with the latest code from the TF and HL2 branches. (diff) | |
| download | source-sdk-2013-master.tar.xz source-sdk-2013-master.zip | |
Diffstat (limited to 'mp/src/public/tier1/utlrbtree.h')
| -rw-r--r-- | mp/src/public/tier1/utlrbtree.h | 7 |
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(); } |