p11_proxy_module_cleanup (void)
{
	State *state, *next;

	state = all_instances;
	all_instances = NULL;

	for (; state != NULL; state = next) {
		next = state->next;
		p11_kit_modules_release (state->loaded);
		p11_virtual_unwrap (state->wrapped);
	}
}
p11_proxy_module_cleanup (void)
{
	State *state, *next;

	state = all_instances;
	all_instances = NULL;

	for (; state != NULL; state = next) {
		next = state->next;
		p11_kit_modules_release (state->loaded);
		p11_virtual_unwrap (state->wrapped);
	}
}