예제 #1
0
/*
 *	Free a module instance.
 */
static void module_instance_free(void *data)
{
	module_instance_t *this = data;

	module_instance_free_old(this->cs, this, time(NULL) + 100);

#ifdef HAVE_PTHREAD_H
	if (this->mutex) {
		/*
		 *	FIXME
		 *	The mutex MIGHT be locked...
		 *	we'll check for that later, I guess.
		 */
		pthread_mutex_destroy(this->mutex);
		talloc_free(this->mutex);
	}
#endif

	/*
	 *	Remove any registered paircompares.
	 */
	paircompare_unregister_instance(this->insthandle);

	xlat_unregister(this->name, NULL, this->insthandle);

#ifndef NDEBUG
	memset(this, 0, sizeof(*this));
#endif
	talloc_free(this);
}
예제 #2
0
/*
 *	Free a module instance.
 */
static void module_instance_free(void *data)
{
	module_instance_t *node = talloc_get_type_abort(data, module_instance_t);

	module_instance_free_old(node->cs, node, time(NULL) + 100);

#ifdef HAVE_PTHREAD_H
	if (node->mutex) {
		/*
		 *	FIXME
		 *	The mutex MIGHT be locked...
		 *	we'll check for that later, I guess.
		 */
		pthread_mutex_destroy(node->mutex);
	}
#endif

	xlat_unregister(node->insthandle, node->name, NULL);

	/*
	 *	Remove all xlat's registered to module instance.
	 */
	if (node->insthandle) {
		/*
		 *	Remove any registered paircompares.
		 */
		paircompare_unregister_instance(node->insthandle);

		xlat_unregister_module(node->insthandle);
	}
	talloc_free(node);
}
예제 #3
0
/*
 *	Free a module instance.
 */
static void module_instance_free(void *data)
{
	module_instance_t *this = data;

	module_instance_free_old(this->cs, this, time(NULL) + 100);

	if (this->entry->module->detach) {
		(this->entry->module->detach)(this->insthandle);
	}

#ifdef HAVE_PTHREAD_H
	if (this->mutex) {
		/*
		 *	FIXME
		 *	The mutex MIGHT be locked...
		 *	we'll check for that later, I guess.
		 */
		pthread_mutex_destroy(this->mutex);
		free(this->mutex);
	}
#endif
	memset(this, 0, sizeof(*this));
	free(this);
}