Search code examples
c++xerces-cxmlspy

XmlSpy: memory leaks in auto-generated xml parser


I generated a C++ xml parser using Altovas XmlSpy 2011R3 SP1. The parser is based on Xerces 3.1 and used as a dynamic link library with MFC support.

I'm getting memory leaks inside xerces just running the example generated with the altova parser that loads a xml from file and does nothing else with it.

Leaks are detected by visual studio and boundschecker. Xerces terminate is properly called. Just loading a xml from file in a loop will result in an out of memory exception, so leaks are growing over time.


Anyone got the same issues? What can I do to get rid of those memory leaks?

Kind regards for any help

My setup:
MSVC 2008
Xerces 3.1
XmlSpy 2011R3
Win XP


Solution

  • This is an confirmed error in the example code provided by Altova. To fix the leaks make sure to always call DestroyDocument to free all Memory.