diff options
author | Milan Crha <mcrha@redhat.com> | 2009-08-06 01:17:58 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-08-11 04:38:28 +0800 |
commit | 1f56992e474023ceca14e57515019cccabd0d083 (patch) | |
tree | 68c1c3e7e6e706bff083df209cb7cc7c08d698e7 /shell | |
parent | 922f8a570fb17c66057b57885769f566e1644a3a (diff) | |
download | gsoc2013-evolution-1f56992e474023ceca14e57515019cccabd0d083.tar gsoc2013-evolution-1f56992e474023ceca14e57515019cccabd0d083.tar.gz gsoc2013-evolution-1f56992e474023ceca14e57515019cccabd0d083.tar.bz2 gsoc2013-evolution-1f56992e474023ceca14e57515019cccabd0d083.tar.lz gsoc2013-evolution-1f56992e474023ceca14e57515019cccabd0d083.tar.xz gsoc2013-evolution-1f56992e474023ceca14e57515019cccabd0d083.tar.zst gsoc2013-evolution-1f56992e474023ceca14e57515019cccabd0d083.zip |
Bug #563795 - Crashed while importing an mbox file in local folder
Diffstat (limited to 'shell')
-rw-r--r-- | shell/e-shell-importer.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/shell/e-shell-importer.c b/shell/e-shell-importer.c index e8185fac3b..0c9b6f8924 100644 --- a/shell/e-shell-importer.c +++ b/shell/e-shell-importer.c @@ -415,7 +415,10 @@ static void import_druid_cancel (GnomeDruid *druid, ImportData *data) { - gtk_widget_destroy (GTK_WIDGET (data->dialog)); + if (data->import_dialog) + gtk_dialog_response (GTK_DIALOG (data->import_dialog), GTK_RESPONSE_CANCEL); + else + gtk_widget_destroy (GTK_WIDGET (data->dialog)); } static gboolean @@ -436,6 +439,15 @@ import_druid_weak_notify (gpointer blah, { ImportData *data = (ImportData *) blah; + if (data->import_dialog && (GObject *)data->import_dialog != where_the_object_was) { + /* postpone freeing of 'data' after the 'import_dialog' will stop, + but also indicate that the 'dialog' gone already */ + data->dialog = NULL; + g_object_weak_ref ((GObject *)data->import_dialog, import_druid_weak_notify, data); + gtk_dialog_response (GTK_DIALOG (data->import_dialog), GTK_RESPONSE_CANCEL); + return; + } + if (data->importerpage->target) e_import_target_free(data->import, data->importerpage->target); g_slist_free(data->importerpage->importers); @@ -469,9 +481,16 @@ static void import_done(EImport *ei, gpointer d) { ImportData *data = d; + gboolean have_dialog = data->dialog != NULL; + + gtk_widget_destroy (data->import_dialog); - gtk_widget_destroy(data->import_dialog); - gtk_widget_destroy(data->dialog); + /* if doesn't have dialog, then the 'data' pointer is freed + on the above destroy call */ + if (have_dialog) { + data->import_dialog = NULL; + gtk_widget_destroy (data->dialog); + } } static void |