[vlc-devel] commit: Win32: use linked_with_a_crap_library_which_uses_atexit() ( libxml2 and libqt4) (Erwan Tulou )

git version control git at videolan.org
Wed Feb 24 21:33:14 CET 2010


vlc | branch: master | Erwan Tulou <erwan10 at videolan.org> | Mon Feb 22 21:55:16 2010 +0100| [2bac8977d8c2d8877dc0c0df7bc635a6dc5cbdf4] | committer: Erwan Tulou 

Win32: use linked_with_a_crap_library_which_uses_atexit() (libxml2 and libqt4)

  On windows,
  - libxml2 spawns a 'watchdog' thread, when statically linked.
  - libqt4 spawns a 'watcher' thread.

  These threads clean up remaining ressources once their initiator thread has
  terminated. So, the associated dll must NOT be freed explicitly and blindly.
  Since there is no means to know when these 'cleanup' threads terminate,
  the safe approach is to not free the dlls and let freeing occur when vlc
  terminates.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2bac8977d8c2d8877dc0c0df7bc635a6dc5cbdf4
---

 modules/gui/qt4/qt4.cpp   |    4 ++++
 modules/misc/xml/libxml.c |    5 +++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index b702756..d3d9ad2 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -246,6 +246,10 @@ vlc_module_begin ()
 
     add_obsolete_bool( "qt-blingbling" ) /* Suppressed since 1.0.0 */
 
+#ifdef WIN32
+    linked_with_a_crap_library_which_uses_atexit()
+#endif
+
     add_submodule ()
         set_description( "Dialogs provider" )
         set_capability( "dialogs provider", 51 )
diff --git a/modules/misc/xml/libxml.c b/modules/misc/xml/libxml.c
index 71f26e6..80c44a5 100644
--- a/modules/misc/xml/libxml.c
+++ b/modules/misc/xml/libxml.c
@@ -45,6 +45,11 @@ vlc_module_begin ()
     set_description( N_("XML Parser (using libxml2)") )
     set_capability( "xml", 10 )
     set_callbacks( Open, Close )
+
+#ifdef WIN32
+    linked_with_a_crap_library_which_uses_atexit()
+#endif
+
 vlc_module_end ()
 
 struct xml_reader_sys_t




More information about the vlc-devel mailing list