A few points that I noticed by reading the code:
1) in ElementXML::rechercherValeurAttribut you call
XMLString::release(&l_poValue), but l_poValue comes from a call to
m_poDOMElement->getAttribute, and should not be released
2) DocumentXML::getFlux doesn't release the l_poString string allocated
by writeToString
3) DocumentXML::getFlux stores the result of the serialization in a
char* m_pcBuffer that is not deleted in the destructor for DocumentXML;
it destroys a previous buffer if called twice on the same object, but it
will not clean the last serialization output
Alberto
radada ha scritto:
There you go : http://www.nabble.com/file/p23421942/batch.tar.gz
batch.tar.gz , and as always : thanks a lot :-D
Alberto Massari wrote:
Could you post your code in a more standard format, like tar.gz?
Thanks,
Alberto
radada ha scritto:
Hi there (again :-()
It may be a little bit long, so I'd like to apologize first.
I'm trying (for my work) to add a functional layer to the xerces library
so
that other developers can use it by calling some more functional methods.
The point is also to raise some particular type of exception so that it
can
be easily reused.
When I directly implement some code to create a small XML file (see
previous
posts), it works perfectly. All my objects are released, and I'm happy.
(the
code is here http://www.nabble.com/file/p23402427/bjtotestGood.cxx
bjtotestGood.cxx )
But I try to encapsulate that into a more functional way, I get a memory
leak.
First I though of doing some nice Oriented Object Programming and
subclass
some of the xerces objects (DOMElement and DOMDocument especially), but I
found out that these classes are pure virtual classes and I can't
subclass
them without redefining all the pure virtual methods.
I tried to subclass the implementation objects (i.e. DOMElementImpl and
DOMDocumentImpl) but I'm stuck with all the Factories and Singeltons
(DOMIplementation and DOMIplementationRegirsty mainly).
So I decide to create some functional objects from scratch (XMLElement
and
XMLDocument) that would not inherit from DOMElement and DOMDocument, but
have theses objects as members of my classes. But when I do that, and I
re-implement the small program to generate some small XML files, I get a
memory leak... I just don't understand, since I do exactly the same thing
that I was doing first. I joined the source code here so that, if you
feel
willing to help, you can get the code :
http://www.nabble.com/file/p23402427/batchTest.rar batchTest.rar
I cleaned the code (we use several libraries) so that it could compile
and
run on any (i hope) UNIX server. I run it on an AIX 5.1
Thanks a lot if you got here, and thanks a lot in advance for your help.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]