gnutls: Fix a crash caused by loading and unloading the module
authorDan Winship <danw@gnome.org>
Mon, 29 Nov 2010 15:07:37 +0000 (10:07 -0500)
committerDan Winship <danw@gnome.org>
Mon, 29 Nov 2010 15:15:56 +0000 (10:15 -0500)
commit187a710254b01ed8bd339f2a351de2adbe7c7765
tree9be8c4bb0e518fc470c50d15dda27e4e03c4aa3f
parentb3c34ce3db83774e33209276dcbaa2b7b6d23b2b
gnutls: Fix a crash caused by loading and unloading the module

If gio-querymodules isn't run to update the cache then gio will need
to load and unload the module at startup time. This was causing
crashes in apps that used gcrypt elsewhere, because gcrypt was being
initialized to use our module's mutex functions, which then no longer
existed after unloading.

Fix this in two different ways: first, force the module to remain
resident after gtls_gnutls_init() has been called, and second, don't
call gtls_gnutls_init() if we're just being called from
g_io_modules_scan_all_in_directory().

https://bugzilla.gnome.org/show_bug.cgi?id=636052
tls/gnutls/gtlsbackend-gnutls.c