From 974ba431d813dea557179a21a02e6084a5b7c4db Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Thu, 19 Nov 2009 23:34:13 +0100 Subject: [PATCH] Only connect input output channel if socket was successfully created --- midori/midori-app.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/midori/midori-app.c b/midori/midori-app.c index b9e49716..434e3469 100644 --- a/midori/midori-app.c +++ b/midori/midori-app.c @@ -675,9 +675,12 @@ midori_app_create_instance (MidoriApp* app, instance = socket_init (instance_name, sokoke_set_config_dir (NULL), &exists); g_object_set_data (G_OBJECT (app), "sock-exists", exists ? (gpointer)0xdeadbeef : NULL); - channel = g_io_channel_unix_new (instance); - g_io_add_watch (channel, G_IO_IN | G_IO_PRI | G_IO_ERR, - (GIOFunc)midori_app_io_channel_watch_cb, app); + if (instance != MidoriAppInstanceNull) + { + channel = g_io_channel_unix_new (instance); + g_io_add_watch (channel, G_IO_IN | G_IO_PRI | G_IO_ERR, + (GIOFunc)midori_app_io_channel_watch_cb, app); + } #endif g_free (instance_name); -- 2.39.5