1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

A few fixes to make irssi work with garbage collected GLIB.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3055 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-12-10 17:31:26 +00:00 committed by cras
parent 0743ce0e39
commit bb55d3ff4d
4 changed files with 12 additions and 4 deletions

View File

@ -52,6 +52,10 @@
# include <gmodule.h> # include <gmodule.h>
#endif #endif
#ifdef USE_GC
# define g_free(x) G_STMT_START { (x) = NULL; } G_STMT_END
#endif
#if defined (UOFF_T_INT) #if defined (UOFF_T_INT)
typedef unsigned int uoff_t; typedef unsigned int uoff_t;
#elif defined (UOFF_T_LONG) #elif defined (UOFF_T_LONG)

View File

@ -106,7 +106,8 @@ static void sig_connected(SERVER_REC *server)
static void sig_disconnected(SERVER_REC *server) static void sig_disconnected(SERVER_REC *server)
{ {
g_free(MODULE_DATA(server)); void *data = MODULE_DATA(server);
g_free(data);
MODULE_DATA_UNSET(server); MODULE_DATA_UNSET(server);
} }
@ -117,7 +118,9 @@ static void sig_channel_created(CHANNEL_REC *channel)
static void sig_channel_destroyed(CHANNEL_REC *channel) static void sig_channel_destroyed(CHANNEL_REC *channel)
{ {
g_free(MODULE_DATA(channel)); void *data = MODULE_DATA(channel);
g_free(data);
MODULE_DATA_UNSET(channel); MODULE_DATA_UNSET(channel);
} }

View File

@ -87,7 +87,8 @@ static char *textbuffer_line_get_format(WINDOW_REC *window, LINE_REC *line,
text = (const unsigned char *) line->text; text = (const unsigned char *) line->text;
/* skip the beginning of the line until we find the format */ /* skip the beginning of the line until we find the format */
g_free(line_read_format(&text)); format_name = line_read_format(&text);
g_free(format_name);
if (text[1] == LINE_CMD_FORMAT_CONT) { if (text[1] == LINE_CMD_FORMAT_CONT) {
if (raw != NULL) { if (raw != NULL) {
g_string_append_c(raw, '\0'); g_string_append_c(raw, '\0');

View File

@ -373,8 +373,8 @@ static void server_cmd_timeout(IRC_SERVER_REC *server, GTimeVal *now)
server_redirect_command(server, cmd, redirect); server_redirect_command(server, cmd, redirect);
/* remove from queue */ /* remove from queue */
g_free(cmd);
server->cmdqueue = g_slist_remove(server->cmdqueue, cmd); server->cmdqueue = g_slist_remove(server->cmdqueue, cmd);
g_free(cmd);
link = server->cmdqueue; link = server->cmdqueue;
server->cmdqueue = g_slist_remove_link(server->cmdqueue, link); server->cmdqueue = g_slist_remove_link(server->cmdqueue, link);