From a00937a9f3789ef3118b7a570e3bc6cb1582a791 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Mon, 30 Jun 2008 18:18:28 +0000 Subject: =?UTF-8?q?Bug=20529634=20=E2=80=93=20ga=5Fclient=5Fstart()=20call?= =?UTF-8?q?ed=20twice?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=8317 --- src/bookmarks/ephy-bookmarks.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'src/bookmarks/ephy-bookmarks.c') diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c index 7cfd86e7d..15f635add 100644 --- a/src/bookmarks/ephy-bookmarks.c +++ b/src/bookmarks/ephy-bookmarks.c @@ -134,6 +134,7 @@ static void ephy_bookmarks_class_init (EphyBookmarksClass *klass); static void ephy_bookmarks_init (EphyBookmarks *tab); static void ephy_bookmarks_finalize (GObject *object); static char *impl_resolve_address (EphyBookmarks*, const char*, const char*); +static void ephy_local_bookmarks_start_client (EphyBookmarks *bookmarks); G_DEFINE_TYPE_WITH_CODE (EphyBookmarks, ephy_bookmarks, G_TYPE_OBJECT, volatile GType flags_type; /* work around gcc's optimiser */ @@ -1132,14 +1133,12 @@ ga_client_state_changed_cb (GaClient *ga_client, { if (avahi_client_errno (ga_client->avahi_client) == AVAHI_ERR_DISCONNECTED) { - /* FIXMEchpe: is this correct */ - /* Destroy and reconnect */ - avahi_client_free (ga_client->avahi_client); - ga_client->avahi_client = NULL; - if (!ga_client_start (ga_client, NULL)) - { - g_warning ("Unable to start Zeroconf subsystem"); - } + EphyBookmarksPrivate *priv = bookmarks->priv; + + g_object_unref (priv->ga_client); + priv->ga_client = NULL; + + ephy_local_bookmarks_start_client (bookmarks); } } if (state == GA_CLIENT_STATE_S_RUNNING) @@ -1149,7 +1148,7 @@ ga_client_state_changed_cb (GaClient *ga_client, } static void -ephy_local_bookmarks_init (EphyBookmarks *bookmarks) +ephy_local_bookmarks_start_client (EphyBookmarks *bookmarks) { EphyBookmarksPrivate *priv = bookmarks->priv; GaClient *ga_client; @@ -1161,12 +1160,20 @@ ephy_local_bookmarks_init (EphyBookmarks *bookmarks) if (!ga_client_start (ga_client, NULL)) { g_warning ("Unable to start Zeroconf subsystem"); + g_object_unref (ga_client); return; } priv->ga_client = ga_client; +} + +static void +ephy_local_bookmarks_init (EphyBookmarks *bookmarks) +{ + EphyBookmarksPrivate *priv = bookmarks->priv; priv->resolve_handles = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) resolve_data_free); + ephy_local_bookmarks_start_client (bookmarks); } static void -- cgit v1.2.3