When resetting the number of children on a ValueObject, also clear the existing child...
authorEnrico Granata <egranata@apple.com>
Wed, 30 Jul 2014 21:23:55 +0000 (21:23 +0000)
committerEnrico Granata <egranata@apple.com>
Wed, 30 Jul 2014 21:23:55 +0000 (21:23 +0000)
llvm-svn: 214341

lldb/include/lldb/Core/ValueObject.h

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