When resetting the number of children on a ValueObject, also clear the existing children. This avoids issues where dynamic types change, but children stay the same

llvm-svn: 214341
This commit is contained in:
Enrico Granata 2014-07-30 21:23:55 +00:00
parent eccdbde667
commit 2aa09d4319
1 changed files with 3 additions and 3 deletions

View File

@ -968,7 +968,7 @@ protected:
void void
SetChildrenCount (size_t count) SetChildrenCount (size_t count)
{ {
m_children_count = count; Clear(count);
} }
size_t size_t
@ -978,10 +978,10 @@ protected:
} }
void void
Clear() Clear(size_t new_count = 0)
{ {
m_children_count = 0;
Mutex::Locker locker(m_mutex); Mutex::Locker locker(m_mutex);
m_children_count = new_count;
m_children.clear(); m_children.clear();
} }