At least when nettle is in use (libgcrypt is hopeless)
#endif
extern void yaz_log_init_globals(void);
+extern void yaz_log_deinit_globals(void);
#if HAVE_GCRYPT_H
GCRY_THREAD_OPTION_PTHREAD_IMPL;
#endif
if (yaz_init_flag)
{
- yaz_log_init_file(0);
+ yaz_log_deinit_globals();
#if HAVE_GNUTLS_H
gnutls_global_deinit();
#endif
}
}
+void yaz_log_deinit_globals(void)
+{
+ if (log_mutex)
+ {
+ yaz_mutex_destroy(&log_mutex);
+ yaz_log_close();
+ }
+}
+
void yaz_log_init_file(const char *fname)
{
yaz_init_globals();