From ac0effafc80492aec8b9b8d19107bb9204c4e713 Mon Sep 17 00:00:00 2001 From: hiro Date: Mon, 28 Dec 2009 08:37:18 +0000 Subject: added missing lock on I/O callback (fixes freeze on remote commands). git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2408 ee746299-78ed-0310-b773-934348b2243d --- ChangeLog | 5 +++++ src/main.c | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 71039baa..c3bf451e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-12-28 + + * src/main.c: lock_socket_input_cb(): added missing lock on I/O + callback (fixes freeze on remote commands). + 2009-12-28 * src/update_check.[ch] diff --git a/src/main.c b/src/main.c index ad698d8b..65a0e475 100644 --- a/src/main.c +++ b/src/main.c @@ -1351,6 +1351,10 @@ static gboolean lock_socket_input_cb(GIOChannel *source, GIOCondition condition, gint fd, sock; gchar buf[BUFFSIZE]; +#if USE_THREADS + gdk_threads_enter(); +#endif + fd = g_io_channel_unix_get_fd(source); sock = fd_accept(fd); fd_gets(sock, buf, sizeof(buf)); @@ -1410,6 +1414,9 @@ static gboolean lock_socket_input_cb(GIOChannel *source, GIOCondition condition, strretchomp(buf); if (strlen(buf) < 6 || buf[4] != ' ') { fd_close(sock); +#if USE_THREADS + gdk_threads_leave(); +#endif return TRUE; } open_message(buf + 5); @@ -1420,6 +1427,10 @@ static gboolean lock_socket_input_cb(GIOChannel *source, GIOCondition condition, fd_close(sock); +#if USE_THREADS + gdk_threads_leave(); +#endif + return TRUE; } -- cgit v1.2.3