Exemplo n.º 1
0
Arquivo: event.c Projeto: k0a1a/pom-ng
int event_finish() {

	while (event_reg_head) {
		pomlog(POMLOG_ERR "Event %s is still registered", event_reg_head->info->name);
		event_unregister(event_reg_head);
	}

	if (event_registry_class)
		registry_remove_class(event_registry_class);
	event_registry_class = NULL;

	return POM_OK;
}
Exemplo n.º 2
0
int registry_cleanup() {

	while (registry_head) {
		if (registry_remove_class(registry_head) != POM_OK)
			return POM_ERR;
	}

	pthread_mutex_destroy(&registry_global_lock);

	free(registry_uid_table);
	
	return POM_OK;
}
Exemplo n.º 3
0
int proto_cleanup() {

    struct proto *proto;
    for (proto = proto_head; proto; proto = proto->next) {

        if (proto->info->cleanup && proto->info->cleanup(proto->priv) == POM_ERR)
            pomlog(POMLOG_WARN "Error while cleaning up protocol %s", proto->info->name);
        conntrack_table_cleanup(proto->ct);

        mod_refcount_dec(proto->info->mod);
    }

    while (proto_head) {
        proto = proto_head;
        proto_head = proto->next;

        int res = pthread_rwlock_destroy(&proto->listeners_lock);
        if (res)
            pomlog(POMLOG_ERR "Error while destroying the listners lock : %s", pom_strerror(res));
        res = pthread_rwlock_destroy(&proto->expectation_lock);
        if (res)
            pomlog(POMLOG_ERR "Error while destroying the listners lock : %s", pom_strerror(res));


        free(proto);
    }

    if (proto_registry_class)
        registry_remove_class(proto_registry_class);
    proto_registry_class = NULL;

    while (proto_number_class_head) {
        struct proto_number_class *cls = proto_number_class_head;
        proto_number_class_head = cls->next;
        while (cls->nums) {
            struct proto_number *num = cls->nums;
            cls->nums = num->next;
            free(num);
        }
        free(cls->name);
        free(cls);
    }

    return POM_OK;
}
Exemplo n.º 4
0
int input_cleanup() {


	if (input_registry_class)
		registry_remove_class(input_registry_class);
	input_registry_class = NULL;

	while (input_reg_head) {

		struct input_reg *tmp = input_reg_head;
		input_reg_head = tmp->next;

		mod_refcount_dec(tmp->info->mod);
		free(tmp);
	}



	return POM_OK;

}
Exemplo n.º 5
0
int output_cleanup() {
	
	pom_mutex_lock(&output_lock);

	if (output_registry_class)
		registry_remove_class(output_registry_class);
	output_registry_class = NULL;

	while (output_reg_head) {

		struct output_reg *tmp = output_reg_head;
		output_reg_head = tmp->next;

		mod_refcount_dec(tmp->reg_info->mod);

		free(tmp);
	}

	pom_mutex_unlock(&output_lock);

	return POM_OK;

}