Пример #1
0
void
servlist_net_remove (ircnet *net)
{
    GSList *list;
    server *serv;

    servlist_server_remove_all (net);
    network_list = g_slist_remove (network_list, net);

    g_free (net->nick);
    g_free (net->nick2);
    g_free (net->user);
    g_free (net->real);
    free_and_clear (net->pass);
    if (net->favchanlist)
        g_slist_free_full (net->favchanlist, (GDestroyNotify) servlist_favchan_free);
    if (net->commandlist)
        g_slist_free_full (net->commandlist, (GDestroyNotify) servlist_command_free);
    g_free (net->encoding);
    g_free (net->name);
    g_free (net);

    /* for safety */
    list = serv_list;
    while (list)
    {
        serv = list->data;
        if (serv->network == net)
        {
            serv->network = NULL;
        }
        list = list->next;
    }
}
Пример #2
0
void
servlist_net_remove (ircnet *net)
{
	GSList *list;
	server *serv;

	servlist_server_remove_all (net);
	network_list = g_slist_remove (network_list, net);

	if (net->nick)
		free (net->nick);
	if (net->nick2)
		free (net->nick2);
	if (net->user)
		free (net->user);
	if (net->real)
		free (net->real);
	free_and_clear (net->pass);
	free_and_clear (net->saslpass);
	if (net->autojoin)
		free (net->autojoin);
	if (net->command)
		free (net->command);
	free_and_clear (net->nickserv);
	if (net->comment)
		free (net->comment);
	if (net->encoding)
		free (net->encoding);
	free (net->name);
	free (net);

	/* for safety */
	list = serv_list;
	while (list)
	{
		serv = list->data;
		if (serv->network == net)
			serv->network = NULL;
		list = list->next;
	}
}
Пример #3
0
void servlist_net_remove (ircnet *net)
{
	std::unique_ptr<ircnet> net_ptr{ net };
	servlist_server_remove_all (net);
	network_list = g_slist_remove (network_list, net);
}