COM DOM Memory Leak in Borland


We are using the Microsoft XML DOM (MSXML 4.0) object in Borland Builder (6.0) and are experiencing massive memory leaks.

We are creating a DOM object thus:

pXMLDoc = new TDOMDocument40(pOwner);
pDocument = pXMLDoc->GetDefaultInterface();

When we are finished we simply delete the object pointed to by pXMLDoc. We believe that we should call release on the object pointed to by pDocument, first, but when we do the deletion of the TDOMDocument40 crashes.

Without the release nothing crashes but if the document has been used in any way then a huge memory leak occurs.

We tried the following creation technique, as seen in the documentation, but it says the class is not registered. Not sure how this can be for these standard classes or whether this is part of the problem.

hr = CoCreateInstance(__uuidof(DOMDocument40),

Thanks for any help you can give,
John Cuming.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!