I agree with sodev. This is a patch that implements the suggestion. I don't see any other problem with the function.
Does someone know how to make C::B execute the changed paths?
I've set some breakpoints on the added delete calls, but I couldn't make C::B hit them with my projects.
Index: src/src/projectmanagerui.cpp
===================================================================
--- src/src/projectmanagerui.cpp (revision 9609)
+++ src/src/projectmanagerui.cpp (working copy)
@@ -2535,7 +2535,10 @@ wxTreeItemId ProjectAddTreeNode(cbProject* project, wxTreeCtrl* tree, const wxS
wxTreeItemId ret;
if (text.IsEmpty())
+ {
+ delete data;
return ret;
+ }
wxString path = text;
@@ -2548,7 +2551,10 @@ wxTreeItemId ProjectAddTreeNode(cbProject* project, wxTreeCtrl* tree, const wxS
path.Remove(0, 1);
if (path.IsEmpty())
+ {
+ delete data;
return ret;
+ }
int pos = path.Find(_T('/'));
if (pos == -1)
@jens: I can't download your valgrind log file. :(