]> spindle.queued.net Git - midori/commitdiff
Only connect input output channel if socket was successfully created
authorChristian Dywan <christian@twotoasts.de>
Thu, 19 Nov 2009 22:34:13 +0000 (23:34 +0100)
committerChristian Dywan <christian@twotoasts.de>
Thu, 19 Nov 2009 22:34:13 +0000 (23:34 +0100)
midori/midori-app.c

index b9e4971667cc9d04a2fc99e83e57a63c3789088c..434e346906c93737fa9f62e72db7bc0cab0ba766 100644 (file)
@@ -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);