[empathy] Handle the EmpathyIndividualWidget disappearing during an async details call



commit 9a1557d2740bcb627033bb2cdd6593d31d081c19
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Sep 2 17:28:38 2010 +0100

    Handle the EmpathyIndividualWidget disappearing during an async details call
    
    The EmpathyIndividualWidget may be destroyed between starting and finishing
    an async call to get contact details. This patch prevents the finishing
    callback from accessing private data which may have been freed.

 libempathy-gtk/empathy-individual-widget.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/libempathy-gtk/empathy-individual-widget.c b/libempathy-gtk/empathy-individual-widget.c
index 08a18d5..36cea8a 100644
--- a/libempathy-gtk/empathy-individual-widget.c
+++ b/libempathy-gtk/empathy-individual-widget.c
@@ -350,15 +350,18 @@ details_feature_prepared_cb (TpConnection *connection,
     DetailsData *data)
 {
   EmpathyIndividualWidget *self = data->widget;
-  EmpathyIndividualWidgetPriv *priv = GET_PRIV (self);
+  EmpathyIndividualWidgetPriv *priv = NULL;
 
-  if (tp_proxy_prepare_finish (connection, res, NULL) == FALSE)
+  if (tp_proxy_prepare_finish (connection, res, NULL) == FALSE || self == NULL)
     {
-      gtk_widget_hide (priv->vbox_details);
+      if (self != NULL)
+        gtk_widget_hide (GET_PRIV (self)->vbox_details);
       details_data_free (data);
       return;
     }
 
+  priv = GET_PRIV (self);
+
   /* Request the Individual's info */
   gtk_widget_show (priv->vbox_details);
   gtk_widget_show (priv->hbox_details_requested);



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