From: Christophe de V. <cde...@al...> - 2003-09-14 12:25:00
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Le Dimanche 14 Septembre 2003 14:18, Fredrik Arnerup a =E9crit : > > xmlInitParser() should be called only once, and only by the main thread > before any other libxml calls. The purpose is to initialize global data, > which normally get initialized automatically when needed, but in a thread= ed > program, that might not be reliable, so you should call xmlInitParser() > explicitly. It should therefore be safe to call it for any program. > > The problem is that libxml++ does not have a global init step (am I right= ?) > and calling xmlInitParser() from each parser constructor is not the corre= ct > thing to do. In fact there is a global init step that set up the callbacks for Node=20 instanciation. You'll find in document.cc. > > I see three options: > > * Call xmlInitParser() from the constructor of some global static objec= t. I think it's the right solution, since this global static object already=20 exists (it's Document::Init). Cheers, Christophe =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQE/ZF47B+sU3TyOQjARAmReAKCOjuthTjyjqlpn1pKOBYm7TETm4wCeKXVz pQ0xvWjR6uX0ZgfQVD986Gs=3D =3D1UFp =2D----END PGP SIGNATURE----- |