From 9a1557d2740bcb627033bb2cdd6593d31d081c19 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 2 Sep 2010 17:28:38 +0100 Subject: 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 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libempathy-gtk/empathy-individual-widget.c b/libempathy-gtk/empathy-individual-widget.c index 08a18d5ff..36cea8a5e 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); -- cgit v1.2.3