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 Dean Roddey <dr...@charmedquark.com> on 2000/07/26 09:03:57 UTC

Re: Initialize/Terminate (was memory leaks in XMLPlatformUtils::Initialize() (v.1.0.1))

> 1) Two applications (each with a main()) use a shared Xerces library. One
> calls Terminate. Can the other still use Xerces? Can the other call
> Initialize()? Maybe Initialize can be called again after Xerces has been
> unloaded, but how do we have any knowledge/control of that?
>

This is not a problem. The two instances will share code pages (in most
systems) but otherwise, there is no relationship. They each have completely
separate data pages.

> 2) A library uses Xerces, but it is not acceptable to change the interface
> of that library to add Intialize/Terminate functions. Anyway, this would
> just pass problem 1) up the chain.
>
> For instance, I have written a Unix/Windows C++ library that uses Xerces-C
> and is wrapped by a Java class via JNI. I now have no idea where to put
the
> call to Initialize(). Also, it is now not very clear whether I really need
> to call Terminate().
>

If Java doesn't provide a way to clean up when the process exits, or when a
class is unloaded, then it could be problematic. OTOH, I kind of find it
hard to believe that we are the only C++ code out there that is wrapped by
Java and which does not provide for arbritrary de-initialization, right? How
are other people in the Java world dealing with this situation?

--------------------------
Dean Roddey
The CIDLib C++ Frameworks
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"You young, and you gotcha health. Whatchoo wanna job fer?"