The ArrayJanitors made the trouble, so I looked in the Xerces FAQ, they recommend to use XMLString::release instead of deleting a string (http://xml.apache.org/xerces-c/faq-build.html#faq-13), which the ArrayJanitors do in reset().
So I tried to replace the ArrayJanitors by ordinary char* and XMLCh* and stumbled upon some multiple code in the XML handlers like in
Code: Select all
if ((element == MappingElement) && !d_font->d_freetype)
{
ArrayJanitor<XMLCh> attr_name(XMLString::transcode(MappingImageAttribute));
ArrayJanitor<char> val_str(XMLString::transcode(attrs.getValue(attr_name.get())));
String image_name((utf8*)val_str.get());
attr_name.reset(XMLString::transcode(MappingCodepointAttribute));
utf32 codepoint = (utf32)XMLString::parseInt(attrs.getValue(attr_name.get()));
....
}
// handle root Font element
else if (element == FontElement)
{
// get name of font we are creating
ArrayJanitor<XMLCh> attr_name(XMLString::transcode(FontNameAttribute));
ArrayJanitor<char> val_str(XMLString::transcode(attrs.getValue(attr_name.get())));
String font_name = (utf8*)val_str.get();
...
}
All the code is about getting a value of an attribute of the current XML element, for this I wrote a helper class with only static methods. In there I uses XMLString::release instead of the ArrayJanitors.
There where a few other occurences of the ArrayJanitor in other files, I replaced them too and the exception vanished.