Irving Reid <[EMAIL PROTECTED]> notes
> We're building an application in c++ on Linux. We began with the > Xerces-C 1.0.1 release, but recently switched to the most recent CVS > version. > > On both versions, we are getting warnings from the compiler when we > turn on strict warnings: [Problems with DOM_NodeFilter.hpp, DOM_NodeIterator.hpp, DOM_TreeWalker.hpp] > As I understand C++, the risk with the non-virtual destructor is that > if you derive from the class and add data members, they may not get > destroyed properly. > > I can't find any places in the Xerces source where any of these are > subclassed. Do they need to have virtual methods? > > If they can be subclassed, the destructors should be defined virtual; > otherwise, the methods should be changed to non-virtual. > The NodeFilter, NodeIterator and TreeWalker classes are pretty badly broken in their current incarnation. The mismatch between the non-virtual destructors and the virtual methods is just one of many problems. New code will be going in, I hope within a day or two. DOM_NodeIterator and DOM_TreeWalker will lose their virtual functions. They shouldn't have had them in the first place; they are like most of the other DOM_* classes in they consist of nothing more than a pointer to an implementation class. DOM_NodeFilter is more like a conventional C++ class. Application programs must create a derived class inorder to use it, and must explicitly new and delete instances themselves. It will retain its virtual functions, and the destructor will be virtual. -- Andy
