# HG changeset patch # User Mark Doliner # Date 1271054718 0 # Node ID fd2d15e577638511956a56f6b83d8ef287baa7e1 # Parent ae2b1f9bde758857d96debba5c65518f26a9697f Why create a wrapper function when you can use g_free directly? diff -r ae2b1f9bde75 -r fd2d15e57763 pidgin/gtkeventloop.c --- a/pidgin/gtkeventloop.c Mon Apr 12 03:42:03 2010 +0000 +++ b/pidgin/gtkeventloop.c Mon Apr 12 06:45:18 2010 +0000 @@ -41,11 +41,6 @@ } PidginIOClosure; -static void pidgin_io_destroy(gpointer data) -{ - g_free(data); -} - static gboolean pidgin_io_invoke(GIOChannel *source, GIOCondition condition, gpointer data) { PidginIOClosure *closure = data; @@ -57,7 +52,7 @@ purple_cond |= PURPLE_INPUT_WRITE; #if 0 - purple_debug(PURPLE_DEBUG_MISC, "gtk_eventloop", + purple_debug_misc("gtk_eventloop", "CLOSURE: callback for %d, fd is %d\n", closure->result, g_io_channel_unix_get_fd(source)); #endif @@ -65,7 +60,7 @@ #ifdef _WIN32 if(! purple_cond) { #ifdef DEBUG - purple_debug(PURPLE_DEBUG_MISC, "gtk_eventloop", + purple_debug:misc("gtk_eventloop", "CLOSURE received GIOCondition of 0x%x, which does not" " match 0x%x (READ) or 0x%x (WRITE)\n", condition, PIDGIN_READ_COND, PIDGIN_WRITE_COND); @@ -110,10 +105,10 @@ channel = g_io_channel_unix_new(fd); closure->result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, cond, - pidgin_io_invoke, closure, pidgin_io_destroy); + pidgin_io_invoke, closure, g_free); #if 0 - purple_debug(PURPLE_DEBUG_MISC, "gtk_eventloop", + purple_debug_misc("gtk_eventloop", "CLOSURE: adding input watcher %d for fd %d\n", closure->result, fd); #endif