Shouldn't be the STL-containers be good enough?), so I didn't try to solve this leaks. I looks as we need to iterate through the array in the destructor of the class that owns this array and call delete for every entry of the array.
Half C::B is written with wx containers, and the other half with stl containers.
That's mostly because historical reasons: wx2.x adviced to try not use the STL at all, because compilers could not support well the STL/templates.
But we are in 2006 now, and the situation has changed (the compilers improved a lot), so that advice is no longer true.
In fact, I hope there will be a transition to use STL whenever possible, because wxWidgets 3.0 (aka wxTNG) will change radically to that way. And it has been said that a wxWidgets <-> boost cooperation is high likely to be done, so wx will use STL and boost instead of reinvent the well. It has been said that even the wxTNG will be sent to boost as a proposal to
the GUI library.

Anyway, especially these problems could have been easily avoided if smart pointers were used (Well, someone said, raw pointers in containers are evil. First I didn't believe it but during the last projects I was working on I learned that this is really true... :? ), but changing this now would possible be a lot of work.
Agreed, if one wants to use smart pointers (boost::shared_ptr) right now with wxWidgets, check
this:
http://wxforum.shadonet.com/viewtopic.php?t=4947I modified the boost files, so that it will automatically call Destroy instead of delete for objects derived with wxWindow. So now, when you write code, it will automatically call Destroy:wxWidgets example:#include <boost/shared_ptr.hpp>
typedef boost::shared_ptr wx_ptr;
wx_ptr<wxMessageDialog> ptr(new wxMessageDialog(...));
I think there could be done in C::B a transition from
wx-containers to
stl-containers, and
pointers to
smart-pointers, either slowly, or all at the same time, creating a new branch, just like when we made the UNICODE transition.
That will for sure create a C::B with almost 0 probability of having mem-leaks, and at the same time contributors like
Der Meister can provide a patch because he understands stl containers but not wx containers.