aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-08-06 01:17:58 +0800
committerMilan Crha <mcrha@redhat.com>2009-08-06 01:17:58 +0800
commitaf049df0c5451734101ff53c6dd1f6e11716bf58 (patch)
tree4905818db2498f8affa326272c95599c4943bc51
parentf5bda4bedf7b9d4f30c31129e71fb727939dca10 (diff)
downloadgsoc2013-evolution-af049df0c5451734101ff53c6dd1f6e11716bf58.tar
gsoc2013-evolution-af049df0c5451734101ff53c6dd1f6e11716bf58.tar.gz
gsoc2013-evolution-af049df0c5451734101ff53c6dd1f6e11716bf58.tar.bz2
gsoc2013-evolution-af049df0c5451734101ff53c6dd1f6e11716bf58.tar.lz
gsoc2013-evolution-af049df0c5451734101ff53c6dd1f6e11716bf58.tar.xz
gsoc2013-evolution-af049df0c5451734101ff53c6dd1f6e11716bf58.tar.zst
gsoc2013-evolution-af049df0c5451734101ff53c6dd1f6e11716bf58.zip
Bug #563795 - Crashed while importing an mbox file in local folder
-rw-r--r--shell/e-shell-importer.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/shell/e-shell-importer.c b/shell/e-shell-importer.c
index 9ad741afe4..b24eca1027 100644
--- a/shell/e-shell-importer.c
+++ b/shell/e-shell-importer.c
@@ -439,7 +439,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
@@ -460,6 +463,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);
@@ -493,9 +505,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