Пример #1
0
void g_dhcp_server_unref(GDHCPServer *dhcp_server)
{
	if (!dhcp_server)
		return;

	if (__sync_fetch_and_sub(&dhcp_server->ref_count, 1) != 1)
		return;

	g_dhcp_server_stop(dhcp_server);

	g_hash_table_destroy(dhcp_server->option_hash);

	destroy_lease_table(dhcp_server);

	g_free(dhcp_server->interface);

	g_free(dhcp_server);
}
Пример #2
0
void g_dhcp_server_unref(GDHCPServer *dhcp_server)
{
	if (dhcp_server == NULL)
		return;

	if (g_atomic_int_dec_and_test(&dhcp_server->ref_count) == FALSE)
		return;

	g_dhcp_server_stop(dhcp_server);

	g_hash_table_destroy(dhcp_server->option_hash);

	destroy_lease_table(dhcp_server);

	g_free(dhcp_server->interface);

	g_free(dhcp_server);
}