List Info

Thread: Question about xmlCleanupParser()




Question about xmlCleanupParser()
user name
2006-09-19 14:35:37
Hi,

I'm having a crash when I call xmlCleanupParser() and I've
some doubts about the use of this function.

I'm developing a library that loads and uses libxml, and I
call xmlCleanupParser in the destructor/DllMain of the
library, when I'm finished using it.

The question is: if someone uses my library and also uses
libxml by his own in a process, my call to xmlCleanupParser
would affect the other instance of libxml?

Thanks in advance,

	Unai 
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
Question about xmlCleanupParser()
user name
2006-09-19 14:48:29
On Tue, Sep 19, 2006 at 04:35:37PM +0200, Unai Astorquiza
wrote:
> Hi,
> 
> I'm having a crash when I call xmlCleanupParser() and
I've some doubts about the use of this function.
> 
> I'm developing a library that loads and uses libxml,
and I call xmlCleanupParser in the destructor/DllMain of the
library, when I'm finished using it.
> 
> The question is: if someone uses my library and also
uses libxml by his own in a process, my call to
xmlCleanupParser would affect the other instance of libxml?

yes, so don't call it, at worse you will just lost a bit of
data global to the
library.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/v
irtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillardredhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ |
Rpmfind RPM search engine  http://rpmfind.net/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
Question about xmlCleanupParser()
user name
2006-09-19 15:13:55
Unai Astorquiza wrote:
> Hi,
> 
> I'm having a crash when I call xmlCleanupParser() and
I've some doubts about the use of this function.
> 
> I'm developing a library that loads and uses libxml,
and I call xmlCleanupParser in the destructor/DllMain of the
library, when I'm finished using it.
> 
> The question is: if someone uses my library and also
uses libxml by his own in a process, my call to
xmlCleanupParser would affect the other instance of libxml?

It all depends on how you link libxml2.

If you link dynamically, this may cause problems if the
client code
links dynamically with a more recent (or older) libxml2, and
your
call to xmlCleanupParser could affect your client code.

If you link statically, there is no problem - all calls are
resolved
when building your DLL, so there should be no unexpected
interaction
with client code.

To me, this makes static linkage seem like the best approach
for using
libxml in a DLL.

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )