mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
GC fixes.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3056 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
bb55d3ff4d
commit
6825f1e67e
@ -209,15 +209,15 @@ static void print_netjoins(NETJOIN_SERVER_REC *server)
|
|||||||
old = gslist_find_icase_string(rec->old_channels,
|
old = gslist_find_icase_string(rec->old_channels,
|
||||||
realchannel);
|
realchannel);
|
||||||
if (old != NULL) {
|
if (old != NULL) {
|
||||||
g_free(old->data);
|
void *data = old->data;
|
||||||
rec->old_channels =
|
rec->old_channels =
|
||||||
g_slist_remove(rec->old_channels,
|
g_slist_remove(rec->old_channels, data);
|
||||||
old->data);
|
g_free(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free(channel);
|
|
||||||
rec->now_channels =
|
rec->now_channels =
|
||||||
g_slist_remove(rec->now_channels, channel);
|
g_slist_remove(rec->now_channels, channel);
|
||||||
|
g_free(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rec->old_channels == NULL)
|
if (rec->old_channels == NULL)
|
||||||
|
@ -268,11 +268,13 @@ view_update_line_cache(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line)
|
|||||||
|
|
||||||
if (rec->count > 1) {
|
if (rec->count > 1) {
|
||||||
for (pos = 0; lines != NULL; pos++) {
|
for (pos = 0; lines != NULL; pos++) {
|
||||||
memcpy(&rec->lines[pos], lines->data,
|
void *data = lines->data;
|
||||||
|
|
||||||
|
memcpy(&rec->lines[pos], data,
|
||||||
sizeof(LINE_CACHE_SUB_REC));
|
sizeof(LINE_CACHE_SUB_REC));
|
||||||
|
|
||||||
g_free(lines->data);
|
lines = g_slist_remove(lines, data);
|
||||||
lines = g_slist_remove(lines, lines->data);
|
g_free(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,11 +31,11 @@ static void ban_free(GSList **list, BAN_REC *rec)
|
|||||||
g_return_if_fail(list != NULL);
|
g_return_if_fail(list != NULL);
|
||||||
g_return_if_fail(rec != NULL);
|
g_return_if_fail(rec != NULL);
|
||||||
|
|
||||||
|
*list = g_slist_remove(*list, rec);
|
||||||
|
|
||||||
g_free(rec->ban);
|
g_free(rec->ban);
|
||||||
g_free_not_null(rec->setby);
|
g_free_not_null(rec->setby);
|
||||||
g_free(rec);
|
g_free(rec);
|
||||||
|
|
||||||
*list = g_slist_remove(*list, rec);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void banlist_free(GSList *banlist)
|
void banlist_free(GSList *banlist)
|
||||||
|
@ -57,8 +57,8 @@ void dcc_unregister_type(const char *type)
|
|||||||
|
|
||||||
pos = gslist_find_string(dcc_types, type);
|
pos = gslist_find_string(dcc_types, type);
|
||||||
if (pos != NULL) {
|
if (pos != NULL) {
|
||||||
g_free(pos->data);
|
|
||||||
dcc_types = g_slist_remove(dcc_types, pos->data);
|
dcc_types = g_slist_remove(dcc_types, pos->data);
|
||||||
|
g_free(pos->data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,12 +129,12 @@ static void flood_hash_destroy(const char *key, FLOOD_REC *flood)
|
|||||||
while (flood->items != NULL) {
|
while (flood->items != NULL) {
|
||||||
FLOOD_ITEM_REC *rec = flood->items->data;
|
FLOOD_ITEM_REC *rec = flood->items->data;
|
||||||
|
|
||||||
|
flood->items = g_slist_remove(flood->items, rec);
|
||||||
|
|
||||||
g_slist_foreach(rec->msgtimes, (GFunc) g_free, NULL);
|
g_slist_foreach(rec->msgtimes, (GFunc) g_free, NULL);
|
||||||
g_slist_free(rec->msgtimes);
|
g_slist_free(rec->msgtimes);
|
||||||
g_free(rec->target);
|
g_free(rec->target);
|
||||||
g_free(rec);
|
g_free(rec);
|
||||||
|
|
||||||
flood->items = g_slist_remove(flood->items, rec);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_free(flood->nick);
|
g_free(flood->nick);
|
||||||
|
@ -613,13 +613,14 @@ static int free_iobject_proto(void *key, void *value, void *chat_type)
|
|||||||
|
|
||||||
static void perl_unregister_protocol(CHAT_PROTOCOL_REC *rec)
|
static void perl_unregister_protocol(CHAT_PROTOCOL_REC *rec)
|
||||||
{
|
{
|
||||||
GSList *item;
|
GSList *item;
|
||||||
|
void *data;
|
||||||
|
|
||||||
item = gslist_find_icase_string(use_protocols, rec->name);
|
item = gslist_find_icase_string(use_protocols, rec->name);
|
||||||
if (item != NULL) {
|
if (item != NULL) {
|
||||||
g_free(item->data);
|
data = item->data;
|
||||||
use_protocols =
|
use_protocols = g_slist_remove(use_protocols, data);
|
||||||
g_slist_remove(use_protocols, item->data);
|
g_free(data);
|
||||||
}
|
}
|
||||||
g_hash_table_foreach_remove(iobject_stashes,
|
g_hash_table_foreach_remove(iobject_stashes,
|
||||||
(GHRFunc) free_iobject_proto,
|
(GHRFunc) free_iobject_proto,
|
||||||
|
Loading…
Reference in New Issue
Block a user