diff options
author | jstebbins <[email protected]> | 2008-11-11 15:50:38 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2008-11-11 15:50:38 +0000 |
commit | e5770abbe687333605b529a7e4656e571ce08cf1 (patch) | |
tree | d6bf4bd7b6b6cb7d199f5026ae2763cff4668738 | |
parent | 198131cb8047afe070bc37a71a35e61a3d8bb7f0 (diff) |
LinGui: fix a race in update checking that causes random crashes
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1914 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | gtk/src/callbacks.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index f7e55189e..e13b97de5 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -2811,6 +2811,7 @@ ghb_net_close(GIOChannel *ioc) gint fd; g_debug("ghb_net_close"); + if (ioc == NULL) return; fd = g_io_channel_unix_get_fd(ioc); close(fd); g_io_channel_unref(ioc); @@ -2839,21 +2840,13 @@ ghb_net_recv_cb(GIOChannel *ioc, GIOCondition cond, gpointer data) if (status == G_IO_STATUS_EOF) { ud->appcast[ud->appcast_len] = 0; - process_appcast(ud); ghb_net_close(ioc); + process_appcast(ud); return FALSE; } return TRUE; } -static gboolean -appcast_timeout_cb(GIOChannel *ioc) -{ - g_debug("appcast_timeout_cb"); - ghb_net_close(ioc); - return FALSE; -} - GIOChannel* ghb_net_open(signal_user_data_t *ud, gchar *address, gint port) { @@ -2891,7 +2884,6 @@ ghb_net_open(signal_user_data_t *ud, gchar *address, gint port) g_io_channel_set_encoding (ioc, NULL, NULL); g_io_channel_set_flags(ioc, G_IO_FLAG_NONBLOCK, NULL); g_io_add_watch (ioc, G_IO_IN, ghb_net_recv_cb, (gpointer)ud ); - g_timeout_add_seconds(20, (GSourceFunc)appcast_timeout_cb, ioc); return ioc; } |