You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Smith, David" <da...@lucent.com> on 2000/07/25 11:21:33 UTC

RE: RE: Re: memory leaks in XMLPlatformUtils::Initialize() (v.1.0 .1)

I had to do this cross platform as well.  I created a small class which
called them in the constructor/destructor, and then created a static
instance.  I know this can have static initialisation order problems, but I
know my app will only use Xerces after main(), so I went this way.  I didn't
put the calls in main (which I guess is another option for an app over a
lib) as I did not want to couple that to the parser.  I only mentioned an
MFC way before as that was the original requirement of the post.

Regards,
Dave

-----Original Message-----
From: Murray.Cumming@GDM.DE [mailto:Murray.Cumming@GDM.DE]
Sent: 25 July 2000 10:08
To: xerces-c-dev@xml.apache.org
Subject: Re: RE: Re: memory leaks in XMLPlatformUtils::Initialize()
(v.1.0.1)




P.Hubczak wrote:
>> How can I call the following sequence repeatedly:
>> XMLPlatformUtils::Initialize();
>> DOMParser parser;
Dave wrote:
> You can't.  These functions do per-process initialisation/termination
work.
> You need to put them in your app's initialisation/termination functions
such as
> InitInstance/ExitInstance.

And if I use it in a (cross-platform) library? Can you think of any
alternative to forcing the user of my library to call initialize/terminate
functions in my library? e.g.  MyLib::Initialize() and MyLib::Terminate.

I don't know exactly what the Xerces' Intialize() and Terminate() do, but I
do think that it is very unpleasant for one library to force another
library to have a particular interface.

Actually, at the moment I am calling XMLPlatformUtils::Initialize()
repeatedly, and I never call XMLPlatformUtils::Terminate(). We have been
investigating memory usage and have found no leaks apart from my own.

Murray Cumming
murrayc@usa.net
www.murrayc.com


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org