return 0;
}
+static int _dict_global_free(dict_gctx_t *ctx)
+{
+ talloc_free(ctx->dict_loader);
+
+ /*
+ * Set this to NULL just in case the caller tries to use
+ * dict_global_init() again.
+ */
+ dict_gctx = NULL;
+ return 0;
+}
+
/** Initialise the global protocol hashes
*
* @note Must be called before any other dictionary functions.
if (dl_symbol_init_cb_register(new_ctx->dict_loader, 0, "dict_protocol", dict_onload_func, NULL) < 0) goto error;
dict_gctx = new_ctx;
+ talloc_set_destructor(dict_gctx, _dict_global_free);
return 0;
}