}
}
+void dict_init_cache_wait_all(void)
+{
+ struct dict_init_cache_list *listp;
+
+ for (listp = dicts; listp != NULL; listp = listp->next)
+ dict_wait(listp->dict);
+}
+
void dict_init_cache_destroy_all(void)
{
timeout_remove(&to_dict);
const struct dict_settings *set,
struct dict **dict_r, const char **error_r);
void dict_init_cache_unref(struct dict **dict);
+
+void dict_init_cache_wait_all(void);
void dict_init_cache_destroy_all(void);
#endif
static void main_deinit(void)
{
- /* FIXME: we're not able to do a clean deinit currently without
- larger changes. */
- lib_exit(0);
timeout_remove(&to_proctitle);
+ /* wait for all dict operations to finish */
+ dict_init_cache_wait_all();
+ /* connections should no longer have any extra refcounts */
dict_connections_destroy_all();
+ dict_init_cache_destroy_all();
+
dict_drivers_unregister_all();
dict_commands_deinit();
master_service_run(master_service, client_connected);
/* clean up cached dicts */
- dict_init_cache_destroy_all();
main_deinit();
master_service_deinit(&master_service);
return 0;