diff options
author | keis <keijser@gmail.com> | 2011-01-05 02:19:40 +0100 |
---|---|---|
committer | keis <keijser@gmail.com> | 2011-01-05 02:19:40 +0100 |
commit | f2f0b1b3cf6b9b6f0ac51d6a20a9b739b2d4c006 (patch) | |
tree | 3b977cff9026bd19172696ca30438d0462b61b28 /src | |
parent | 55ce375945db478c563ed3e04dd2db86049ed20e (diff) |
unref IOChannel after shutdown
Diffstat (limited to 'src')
-rw-r--r-- | src/uzbl-core.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/uzbl-core.c b/src/uzbl-core.c index c6813ea..c451f86 100644 --- a/src/uzbl-core.c +++ b/src/uzbl-core.c @@ -1692,13 +1692,12 @@ gboolean remove_socket_from_array(GIOChannel *chan) { gboolean ret = 0; - /* TODO: Do wee need to manually free the IO channel or is this - * happening implicitly on unref? - */ ret = g_ptr_array_remove_fast(uzbl.comm.connect_chan, chan); if(!ret) ret = g_ptr_array_remove_fast(uzbl.comm.client_chan, chan); + if(ret) + g_io_channel_unref (chan); return ret; } @@ -1772,17 +1771,17 @@ control_client_socket(GIOChannel *clientchan) { if (ret == G_IO_STATUS_ERROR) { g_warning ("Error reading: %s", error->message); g_clear_error (&error); - remove_socket_from_array (clientchan); ret = g_io_channel_shutdown (clientchan, TRUE, &error); + remove_socket_from_array (clientchan); if (ret == G_IO_STATUS_ERROR) { g_warning ("Error closing: %s", error->message); g_clear_error (&error); } return FALSE; } else if (ret == G_IO_STATUS_EOF) { - remove_socket_from_array (clientchan); /* shutdown and remove channel watch from main loop */ ret = g_io_channel_shutdown (clientchan, TRUE, &error); + remove_socket_from_array (clientchan); if (ret == G_IO_STATUS_ERROR) { g_warning ("Error closing: %s", error->message); g_clear_error (&error); |