]> git.saurik.com Git - wxWidgets.git/commitdiff
Replace node deletion with Erase
authorJulian Smart <julian@anthemion.co.uk>
Sat, 22 Oct 2005 08:05:19 +0000 (08:05 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sat, 22 Oct 2005 08:05:19 +0000 (08:05 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35979 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextbuffer.cpp

index 57846be1f70ec89b43f35832af74f0287efd4530..2257206c1b53de8c551bc65f10b599792e32507f 100644 (file)
@@ -174,9 +174,10 @@ bool wxRichTextCompositeObject::RemoveChild(wxRichTextObject* child, bool delete
     wxRichTextObjectList::compatibility_iterator node = m_children.Find(child);
     if (node)
     {
     wxRichTextObjectList::compatibility_iterator node = m_children.Find(child);
     if (node)
     {
+        wxRichTextObject* obj = node->GetData();
+        m_children.Erase(node);
         if (deleteChild)
         if (deleteChild)
-            delete node->GetData();
-        delete node;
+            delete obj;
 
         return true;
     }
 
         return true;
     }
@@ -195,7 +196,7 @@ bool wxRichTextCompositeObject::DeleteChildren()
         child->Dereference(); // Only delete if reference count is zero
 
         node = node->GetNext();
         child->Dereference(); // Only delete if reference count is zero
 
         node = node->GetNext();
-        delete oldNode;
+        m_children.Erase(oldNode);
     }
 
     return true;
     }
 
     return true;