epiphany r8324 - branches/gnome-2-22/src/bookmarks



Author: chpe
Date: Mon Jun 30 18:22:09 2008
New Revision: 8324
URL: http://svn.gnome.org/viewvc/epiphany?rev=8324&view=rev

Log:
Bug 529634 â ga_client_start() called twice

Modified:
   branches/gnome-2-22/src/bookmarks/ephy-bookmarks.c

Modified: branches/gnome-2-22/src/bookmarks/ephy-bookmarks.c
==============================================================================
--- branches/gnome-2-22/src/bookmarks/ephy-bookmarks.c	(original)
+++ branches/gnome-2-22/src/bookmarks/ephy-bookmarks.c	Mon Jun 30 18:22:09 2008
@@ -135,6 +135,7 @@
 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 */
@@ -1133,14 +1134,12 @@
 	{
 		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)
@@ -1150,7 +1149,7 @@
 }
 
 static void
-ephy_local_bookmarks_init (EphyBookmarks *bookmarks)
+ephy_local_bookmarks_start_client (EphyBookmarks *bookmarks)
 {
 	EphyBookmarksPrivate *priv = bookmarks->priv;
 	GaClient *ga_client;
@@ -1162,12 +1161,20 @@
 	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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]