[geary/geary-0.13] Fix inifinite loop removing folders that have disappeared
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/geary-0.13] Fix inifinite loop removing folders that have disappeared
- Date: Wed, 20 Feb 2019 12:31:52 +0000 (UTC)
commit f2d73106900ea52f250161e352e4233785e5fe6c
Author: Michael Gratton <mike vee net>
Date: Wed Feb 20 21:43:48 2019 +1100
Fix inifinite loop removing folders that have disappeared
Brown paper bag misuse of BidiIterator 🙄
src/client/application/geary-controller.vala | 3 +--
src/engine/imap-engine/imap-engine-generic-account.vala | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/src/client/application/geary-controller.vala b/src/client/application/geary-controller.vala
index e76c5c20..499b5d99 100644
--- a/src/client/application/geary-controller.vala
+++ b/src/client/application/geary-controller.vala
@@ -1442,9 +1442,8 @@ public class GearyController : Geary.BaseObject {
Gee.BidirIterator<Geary.Folder> unavailable_iterator =
unavailable.bidir_iterator();
unavailable_iterator.last();
- while (unavailable_iterator.valid) {
+ while (unavailable_iterator.previous()) {
Geary.Folder folder = unavailable_iterator.get();
- unavailable_iterator.previous();
main_window.folder_list.remove_folder(folder);
if (folder.account == current_account) {
diff --git a/src/engine/imap-engine/imap-engine-generic-account.vala
b/src/engine/imap-engine/imap-engine-generic-account.vala
index 83369212..165254d0 100644
--- a/src/engine/imap-engine/imap-engine-generic-account.vala
+++ b/src/engine/imap-engine/imap-engine-generic-account.vala
@@ -1323,9 +1323,8 @@ internal class Geary.ImapEngine.UpdateRemoteFolders : AccountOperation {
Gee.BidirIterator<MinimalFolder> removed_iterator =
removed.bidir_iterator();
removed_iterator.last();
- while (removed_iterator.valid) {
+ while (removed_iterator.previous()) {
MinimalFolder folder = removed_iterator.get();
- removed_iterator.previous();
try {
debug("Locally deleting removed folder %s", folder.to_string());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]