Sid wrote:
>
> The problem is now fixed but it kept crashing the second time the
> SAXParser was being created.
>
> Chris Prior wrote:
> >
> > From initial observations you should not call
> > XMLPlatformUtils::Initialize() and XMLPlatformUtils::Terminate()
> > multiple times in a process (they should be called once in the whole
> > process space lifetime). I think this functionality may have been
> > fixed in 1.6

If I'm not mistaken you can now do the following in 1.6: Call Initialize()
N times, then call Terminate() (N - 1) times, and things still work. Once
you call Terminate() for the Nth time you cannot use Xerces features
anymore. In other words, it behaves like a stack.

Once the last stacked-up Initialize() call is balanced with the
corresponding Terminate() call it is not possible to properly
re-initialize Xerces. The reason has to do with global variables that are
used to record whether certain modules are initialized. Once they are,
they are never initialized again. The last Terminate() call frees some
memory, but the global variables continue to point to this freed memory
resulting in crashes when Xerces is used subsequently.

This is certainly not ideal. It would be better if the final Terminate()
call returned the system to the same state as before the first
Initialize(), in which case it would be possible to re-initialize the
system again.

In the meantime, applications that use parsers repeatedly probably
shouldn't bother calling Terminate() at all.

Joachim

-- 
work:     [EMAIL PROTECTED]  (http://www.netacquire.com)
private:  [EMAIL PROTECTED]         (http://www.kraut.ca)



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to