aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/message-list.c6
-rw-r--r--modules/mail/e-mail-shell-view-private.c7
2 files changed, 12 insertions, 1 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index 14ef44fe91..154080eb19 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -3850,6 +3850,12 @@ message_list_set_folder (MessageList *message_list,
if (message_list->folder == folder)
return;
+ g_free (message_list->search);
+ message_list->search = NULL;
+
+ g_free (message_list->frozen_search);
+ message_list->frozen_search = NULL;
+
if (message_list->seen_id) {
g_source_remove (message_list->seen_id);
message_list->seen_id = 0;
diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c
index 9a58f9d2b7..e043d7d49e 100644
--- a/modules/mail/e-mail-shell-view-private.c
+++ b/modules/mail/e-mail-shell-view-private.c
@@ -852,8 +852,13 @@ e_mail_shell_view_restore_state (EMailShellView *mail_shell_view)
reader = E_MAIL_READER (mail_view);
folder = e_mail_reader_get_folder (reader);
- if (folder == NULL)
+ if (folder == NULL) {
+ if (e_shell_searchbar_get_state_group (searchbar)) {
+ e_shell_searchbar_set_state_group (searchbar, NULL);
+ e_shell_searchbar_load_state (searchbar);
+ }
return;
+ }
/* Do not restore state if we're running a "Current Account"
* or "All Accounts" search, since we don't want the search