mirror of
https://github.com/irssi/irssi.git
synced 2026-08-16 15:12:11 +02:00
Fixed a few minor memleaks. Don't use g_strdup() in lib-popt because it may
be freed with a real free() call instead of g_free(). git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2352 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
08c23ce6d4
commit
747d0f19ca
5 changed files with 23 additions and 3 deletions
|
|
@ -75,14 +75,32 @@ static void sig_chatnet_saved(IRC_CHATNET_REC *rec, CONFIG_NODE *node)
|
|||
iconfig_node_set_int(node, "max_whois", rec->max_whois);
|
||||
}
|
||||
|
||||
static void sig_chatnet_destroyed(IRC_CHATNET_REC *rec)
|
||||
{
|
||||
if (IS_IRC_CHATNET(rec))
|
||||
g_free(rec->usermode);
|
||||
}
|
||||
|
||||
|
||||
void irc_chatnets_init(void)
|
||||
{
|
||||
signal_add("chatnet read", (SIGNAL_FUNC) sig_chatnet_read);
|
||||
signal_add("chatnet saved", (SIGNAL_FUNC) sig_chatnet_saved);
|
||||
signal_add("chatnet destroyed", (SIGNAL_FUNC) sig_chatnet_destroyed);
|
||||
}
|
||||
|
||||
void irc_chatnets_deinit(void)
|
||||
{
|
||||
GSList *tmp, *next;
|
||||
|
||||
for (tmp = chatnets; tmp != NULL; tmp = next) {
|
||||
CHATNET_REC *rec = tmp->data;
|
||||
|
||||
if (IS_IRC_CHATNET(rec))
|
||||
chatnet_destroy(rec);
|
||||
}
|
||||
|
||||
signal_remove("chatnet read", (SIGNAL_FUNC) sig_chatnet_read);
|
||||
signal_remove("chatnet saved", (SIGNAL_FUNC) sig_chatnet_saved);
|
||||
signal_remove("chatnet destroyed", (SIGNAL_FUNC) sig_chatnet_destroyed);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue