it seems different xerces-c versions want different delete
(delete or delete[]) for some strings they have allocated.
put a xerces-c version check before the delete/delete[] call
to try to call the correct version based on xerces-c version.
This gets rid of some valgrind warnings.
@@ -84,7 +84,14 @@ std::string
Conversion::XMLChToString(const XMLCh* ch) {
char* sz = XMLString::transcode(ch);
std::string ret = sz;
+ // TODO: xercesc version 3.1 wants delete, not delete[].
+ // xercesc version 2.8 wants delete[], not delete.
+ // not sure which was the actual version where this changed.
+#if _XERCES_VERSION < 30000
delete[] sz;
+#else
+ delete sz;
+#endif
return ret;
}
