diff options
author | Christian Persch <chpe@src.gnome.org> | 2008-07-01 02:18:28 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2008-07-01 02:18:28 +0800 |
commit | a00937a9f3789ef3118b7a570e3bc6cb1582a791 (patch) | |
tree | 9f4d25dc84dac812407bd52449738f0ed0d7fa58 /src/bookmarks | |
parent | 9d4fb5100eaeac5bb304c33d05f9e2d2dc967828 (diff) | |
download | gsoc2013-epiphany-a00937a9f3789ef3118b7a570e3bc6cb1582a791.tar.gz gsoc2013-epiphany-a00937a9f3789ef3118b7a570e3bc6cb1582a791.tar.zst gsoc2013-epiphany-a00937a9f3789ef3118b7a570e3bc6cb1582a791.zip |
Bug 529634 – ga_client_start() called twice
svn path=/trunk/; revision=8317
Diffstat (limited to 'src/bookmarks')
-rw-r--r-- | src/bookmarks/ephy-bookmarks.c | 25 |
1 files changed, 16 insertions, 9 deletions
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 |