]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/init.c
syncinfo_free must be able to free multiple syncinfos
[openldap] / servers / slapd / init.c
index 0e392e2189d88a67233046cf1eac9bcdc442b0f2..3cff69e3e63765e010dc5d6537c2b74684a983b8 100644 (file)
@@ -65,9 +65,7 @@ struct berval NoAttrs = BER_BVC( LDAP_NO_ATTRS );
 ldap_pvt_thread_pool_t connection_pool;
 int                    connection_pool_max = SLAP_MAX_WORKER_THREADS;
 int            slap_tool_thread_max = 1;
-#ifndef HAVE_GMTIME_R
 ldap_pvt_thread_mutex_t        gmtime_mutex;
-#endif
 
 slap_counters_t                        slap_counters;
 
@@ -160,9 +158,7 @@ slap_init( int mode, const char *name )
                }
 #endif /* SLAPD_MONITOR */
 
-#ifndef HAVE_GMTIME_R
                ldap_pvt_thread_mutex_init( &gmtime_mutex );
-#endif
                slap_passwd_init();
 
                rc = slap_sasl_init();
@@ -271,6 +267,9 @@ int slap_destroy(void)
                ber_bvarray_free( default_referral );
        }
 
+       /* clear out any thread-keys for the main thread */
+       ldap_pvt_thread_pool_context_reset( ldap_pvt_thread_pool_context());
+
        rc = backend_destroy();
 
        slap_sasl_destroy();