From: Sergio Villar Senin Date: Mon, 27 Oct 2008 15:57:22 +0000 (+0000) Subject: * Fixes NB#90942, fixes a crash when moving a deleted message X-Git-Tag: git_migration_finished~1097 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=af17de7a3953d30c97a8a3e547ef00ca4704dbf3;hp=fed20fd1c7aa7210ad7b0fa61ee78bee5db91ef2 * Fixes NB#90942, fixes a crash when moving a deleted message * Fixes some other problems with row references pmo-trunk-r6166 --- diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index d7da2b9..1f42f68 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -530,11 +530,11 @@ modest_ui_actions_on_delete_message (GtkAction *action, ModestWindow *win) } /* Free */ - if (next_row_reference != NULL) + if (gtk_tree_row_reference_valid (next_row_reference)) gtk_tree_row_reference_free (next_row_reference); if (next_path != NULL) gtk_tree_path_free (next_path); - if (prev_row_reference != NULL) + if (gtk_tree_row_reference_valid (prev_row_reference)) gtk_tree_row_reference_free (prev_row_reference); if (prev_path != NULL) gtk_tree_path_free (prev_path); @@ -4820,8 +4820,10 @@ move_to_helper_destroyer (gpointer user_data) gtk_widget_destroy (GTK_WIDGET (helper->banner)); g_object_unref (helper->banner); } - if (helper->reference != NULL) + if (gtk_tree_row_reference_valid (helper->reference)) { gtk_tree_row_reference_free (helper->reference); + helper->reference = NULL; + } g_free (helper); } @@ -4845,7 +4847,8 @@ move_to_cb (ModestMailOperation *mail_op, /* No more messages to view, so close this window */ modest_ui_actions_on_close_window (NULL, MODEST_WINDOW(self)); } - } else if (MODEST_IS_MAIN_WINDOW (object) && helper->reference != NULL) { + } else if (MODEST_IS_MAIN_WINDOW (object) && + gtk_tree_row_reference_valid (helper->reference)) { GtkWidget *header_view; GtkTreePath *path; GtkTreeSelection *sel;