Hello,

I have a strange case where I have several DLLs being loaded to a
process, and some of them need Xerces/Xalan initialization performed in
order to use the Xerces/Xalan code. Now, I cannot tell if the
initialization has been performed (I found no way at least) when "my"
DLL loads because there might be some other DLL loaded before me that
did the same thing, so I must initialize again (potentially for the
second or third time). This does not look harmless - even though that
documentation claims that this is possible and only slightly inefficient
(in this scenario it is for sure thread safe). Xerces initialization
guards itself from multiple initializations, but Xalan does not, blindly
allocating (at least one) object and storing a pointer to the same
global variable, over and over again. I don't see how we can avoid
memory leaks here? Why isn't there in place any kind of guard (similar
to Xerces) - I know it would not be thread safe, but at least is works
in scenarios like this one?

I know I can enforce this myself, adding another level of indirection
(all problems can be solved by adding levels of indirection :)) ) but I
was just wandering if I missed something or if the documentation has to
be amended...

Thanks,

Drazen

Reply via email to