* account has been created */
gboolean account_created;
+ /* if TRUE, the GTK+ destroy signal has been fired and so the widgets
+ * embedded in this account widget can't be used any more
+ * workaround because some async callbacks can be called after the
+ * widget has been destroyed */
+ gboolean destroyed;
+
TpAccountManager *account_manager;
gboolean dispose_run;
}
}
+ /* unref widget - part of the workaround */
g_object_unref (widget);
g_free (message);
g_free (status);
if (priv->creating_account)
{
/* By default, when an account is created, we enable it. */
+
+ /* workaround to keep widget alive during async call */
g_object_ref (widget);
+
tp_account_set_enabled_async (account, TRUE,
account_widget_account_enabled_cb, widget);
priv->account_created = TRUE;
}
}
- account_widget_set_control_buttons_sensitivity (widget, FALSE);
+ if (!priv->destroyed)
+ account_widget_set_control_buttons_sensitivity (widget, FALSE);
+
+ /* unref the widget - part of the workaround */
g_object_unref (widget);
}
{
EmpathyAccountWidgetPriv *priv = GET_PRIV (self);
+ /* workaround to keep widget alive during async call */
g_object_ref (self);
empathy_account_settings_apply_async (priv->settings,
account_widget_applied_cb, self);
account_widget_destroy_cb (GtkWidget *widget,
EmpathyAccountWidget *self)
{
+ EmpathyAccountWidgetPriv *priv = GET_PRIV (self);
+ /* set the destroyed flag - workaround */
+ priv->destroyed = TRUE;
+
g_object_unref (self);
}
account = empathy_account_settings_get_account (priv->settings);
/* Enable the account according to the value of the "Enabled" checkbox */
+ /* workaround to keep widget alive during async call */
g_object_ref (user_data);
tp_account_set_enabled_async (account, state,
account_widget_account_enabled_cb, user_data);