From: Christian Dywan Date: Thu, 19 Nov 2009 22:34:13 +0000 (+0100) Subject: Only connect input output channel if socket was successfully created X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=974ba431d813dea557179a21a02e6084a5b7c4db;p=midori Only connect input output channel if socket was successfully created --- 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);