aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-04-21 15:49:06 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:55 +0800
commitaa04904de8d7344e33d72e1e3e3c1f140c717951 (patch)
treeede2ba531ba9c9e9113d461d364d01f965a15990
parentd8296e9f45a1c7cf80f430d62da781bb5f30f441 (diff)
downloadgsoc2013-evolution-aa04904de8d7344e33d72e1e3e3c1f140c717951.tar.gz
gsoc2013-evolution-aa04904de8d7344e33d72e1e3e3c1f140c717951.tar.zst
gsoc2013-evolution-aa04904de8d7344e33d72e1e3e3c1f140c717951.zip
Bug #641154 - Crash in emae_check_authtype_done
-rw-r--r--mail/em-account-editor.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index 7d9f5aee3d..639c82f251 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -130,6 +130,7 @@ typedef struct _EMAccountEditorService {
GtkWidget *check_dialog;
gint check_id;
+ struct _EMAccountEditorService **check_data;
GList *authtypes; /* if "Check supported" */
CamelProvider *provider;
@@ -1936,9 +1937,18 @@ emae_check_authtype_done (const gchar *uri,
GList *types,
gpointer data)
{
- EMAccountEditorService *service = data;
+ EMAccountEditorService **pservice = data;
+ EMAccountEditorService *service;
GtkWidget *editor;
+ g_return_if_fail (pservice != NULL);
+
+ service = *pservice;
+ if (!service) {
+ g_free (pservice);
+ return;
+ }
+
editor = E_CONFIG (service->emae->config)->window;
if (service->check_dialog) {
@@ -1954,7 +1964,10 @@ emae_check_authtype_done (const gchar *uri,
gtk_widget_set_sensitive (editor, TRUE);
service->check_id = -1;
+ service->check_data = NULL;
g_object_unref (service->emae);
+ *pservice = NULL;
+ g_free (pservice);
}
static void
@@ -1966,6 +1979,9 @@ emae_check_authtype_response (GtkWidget *d,
editor = E_CONFIG (service->emae->config)->window;
+ if (service->check_data)
+ (*service->check_data) = NULL;
+ service->check_data = NULL;
mail_msg_cancel (service->check_id);
gtk_widget_destroy (service->check_dialog);
service->check_dialog = NULL;
@@ -1979,6 +1995,7 @@ emae_check_authtype (GtkWidget *w,
EMAccountEditorService *service)
{
EMAccountEditor *emae = service->emae;
+ EMAccountEditorService **pservice;
EMailSession *session;
EAccount *account;
GtkWidget *editor;
@@ -2000,9 +2017,12 @@ emae_check_authtype (GtkWidget *w,
if (editor != NULL)
gtk_widget_set_sensitive (editor, FALSE);
+ pservice = g_new0 (EMAccountEditorService *, 1);
+ *pservice = service;
+ service->check_data = pservice;
service->check_id = mail_check_service (
session, uri, service->type,
- emae_check_authtype_done, service);
+ emae_check_authtype_done, pservice);
}
static void