empathy r2627 - trunk/libempathy-gtk



Author: xclaesse
Date: Sun Mar  8 09:45:27 2009
New Revision: 2627
URL: http://svn.gnome.org/viewvc/empathy?rev=2627&view=rev

Log:
Prevent an infinite loop when query tooltip on contact list view.

From: Xavier Claessens <xclaesse gmail com>

Modified:
   trunk/libempathy-gtk/empathy-contact-list-view.c

Modified: trunk/libempathy-gtk/empathy-contact-list-view.c
==============================================================================
--- trunk/libempathy-gtk/empathy-contact-list-view.c	(original)
+++ trunk/libempathy-gtk/empathy-contact-list-view.c	Sun Mar  8 09:45:27 2009
@@ -141,16 +141,24 @@
 	GtkTreeModel               *model;
 	GtkTreeIter                 iter;
 	GtkTreePath                *path;
+	static gboolean             running = FALSE;
+	gboolean                    ret = FALSE;
+
+	/* Avoid an infinite loop. See GNOME bug #574377 */
+	if (running) {
+		return FALSE;
+	}
+	running = TRUE;
 
 	/* FIXME: We need GTK version >= 2.12.10. See GNOME bug #504087 */
 	if (gtk_check_version (2, 12, 10)) {
-		return FALSE;
+		goto OUT;
 	}
 
 	if (!gtk_tree_view_get_tooltip_context (GTK_TREE_VIEW (view), &x, &y,
 						keyboard_mode,
 						&model, &path, &iter)) {
-		return FALSE;
+		goto OUT;
 	}
 
 	gtk_tree_view_set_tooltip_row (GTK_TREE_VIEW (view), tooltip, path);
@@ -160,7 +168,7 @@
 			    EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, &contact,
 			    -1);
 	if (!contact) {
-		return FALSE;
+		goto OUT;
 	}
 
 	if (!priv->tooltip_widget) {
@@ -176,10 +184,13 @@
 	}
 
 	gtk_tooltip_set_custom (tooltip, priv->tooltip_widget);
+	ret = TRUE;
 
 	g_object_unref (contact);
+OUT:
+	running = FALSE;
 
-	return TRUE;
+	return ret;
 }
 
 static void



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