aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-06-02 17:12:20 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-06-02 17:12:20 +0800
commit4275c11d4f298285edf144124ddad56504d9db5b (patch)
treee184c0b6376405e727a374602326864408cbbc16 /libempathy-gtk
parent347d1e3052284782519f0fac530a1dfac4b1ee28 (diff)
downloadgsoc2013-empathy-4275c11d4f298285edf144124ddad56504d9db5b.tar
gsoc2013-empathy-4275c11d4f298285edf144124ddad56504d9db5b.tar.gz
gsoc2013-empathy-4275c11d4f298285edf144124ddad56504d9db5b.tar.bz2
gsoc2013-empathy-4275c11d4f298285edf144124ddad56504d9db5b.tar.lz
gsoc2013-empathy-4275c11d4f298285edf144124ddad56504d9db5b.tar.xz
gsoc2013-empathy-4275c11d4f298285edf144124ddad56504d9db5b.tar.zst
gsoc2013-empathy-4275c11d4f298285edf144124ddad56504d9db5b.zip
Do not ref tooltip_widget otherwise it never gets destroyed.
svn path=/trunk/; revision=1133
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-list-view.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 56d5eb1a1..6f8bd064d 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -117,19 +117,6 @@ static guint signals[LAST_SIGNAL];
G_DEFINE_TYPE (EmpathyContactListView, empathy_contact_list_view, GTK_TYPE_TREE_VIEW);
-static void
-contact_list_view_tooltip_destroy_cb (GtkWidget *widget,
- EmpathyContactListView *view)
-{
- EmpathyContactListViewPriv *priv = GET_PRIV (view);
-
- DEBUG ("Tooltip destroyed");
- if (priv->tooltip_widget) {
- g_object_unref (priv->tooltip_widget);
- priv->tooltip_widget = NULL;
- }
-}
-
static gboolean
contact_list_view_query_tooltip_cb (EmpathyContactListView *view,
gint x,
@@ -162,15 +149,14 @@ contact_list_view_query_tooltip_cb (EmpathyContactListView *view,
if (!priv->tooltip_widget) {
priv->tooltip_widget = empathy_contact_widget_new (contact,
- EMPATHY_CONTACT_WIDGET_EDIT_NONE);
- g_object_ref (priv->tooltip_widget);
- g_signal_connect (priv->tooltip_widget, "destroy",
- G_CALLBACK (contact_list_view_tooltip_destroy_cb),
- view);
-
+ EMPATHY_CONTACT_WIDGET_EDIT_NONE);
+ g_object_add_weak_pointer (G_OBJECT (priv->tooltip_widget),
+ (gpointer) &priv->tooltip_widget);
} else {
- empathy_contact_widget_set_contact (priv->tooltip_widget, contact);
+ empathy_contact_widget_set_contact (priv->tooltip_widget,
+ contact);
}
+
gtk_tooltip_set_custom (tooltip, priv->tooltip_widget);
g_object_unref (contact);
@@ -980,10 +966,6 @@ contact_list_view_finalize (GObject *object)
g_object_unref (priv->store);
}
- if (priv->tooltip_widget) {
- g_object_unref (priv->tooltip_widget);
- }
-
G_OBJECT_CLASS (empathy_contact_list_view_parent_class)->finalize (object);
}