Fix memory leak in richtext sample.

Destroy the children of wxRichTextFieldTypeCompositeTest when updating it
instead of just clearing the list and leaking the objects in it.

Closes #14324.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78037 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-10-19 12:56:51 +00:00
parent 870051c765
commit 340a7f8526

View File

@@ -127,7 +127,7 @@ public:
attr.SetLineSpacing(10);
obj->SetAttributes(attr);
}
obj->GetChildren().Clear();
obj->DeleteChildren();
wxRichTextParagraph* para = new wxRichTextParagraph;
wxRichTextPlainText* text = new wxRichTextPlainText(GetLabel());
para->AppendChild(text);