[geary] Fix critical warning when folder opening remote connection.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary] Fix critical warning when folder opening remote connection.
- Date: Thu, 4 Aug 2016 00:52:56 +0000 (UTC)
commit 05cfb77dca29fc11190e3c3e69d9596aa7f4a1be
Author: Michael James Gratton <mike vee net>
Date: Thu Aug 4 10:34:49 2016 +1000
Fix critical warning when folder opening remote connection.
* src/engine/imap-engine/imap-engine-minimal-folder.vala
(MinimalFolder::start_remote_open_timer): Set the soruce id to 0 when
the timer callback executes, so it is not attempted to be removed in
the future. Tidy up the source a bit.
.../imap-engine/imap-engine-minimal-folder.vala | 26 ++++++++++----------
1 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/src/engine/imap-engine/imap-engine-minimal-folder.vala
b/src/engine/imap-engine/imap-engine-minimal-folder.vala
index b4279d0..09486f4 100644
--- a/src/engine/imap-engine/imap-engine-minimal-folder.vala
+++ b/src/engine/imap-engine/imap-engine-minimal-folder.vala
@@ -572,18 +572,18 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
return true;
}
-
+
private void start_remote_open_timer() {
- if (open_remote_timer_id != 0)
- Source.remove(open_remote_timer_id);
-
- open_remote_timer_id = Timeout.add_seconds(FORCE_OPEN_REMOTE_TIMEOUT_SEC, () => {
+ if (this.open_remote_timer_id != 0)
+ Source.remove(this.open_remote_timer_id);
+
+ this.open_remote_timer_id = Timeout.add_seconds(FORCE_OPEN_REMOTE_TIMEOUT_SEC, () => {
start_remote_open_now();
-
+ this.open_remote_timer_id = 0;
return false;
});
}
-
+
private void start_remote_open_now() {
if (remote_opened)
return;
@@ -593,15 +593,15 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
open_remote_async.begin(null);
}
-
+
private void cancel_remote_open_timer() {
- if (open_remote_timer_id == 0)
+ if (this.open_remote_timer_id == 0)
return;
-
- Source.remove(open_remote_timer_id);
- open_remote_timer_id = 0;
+
+ Source.remove(this.open_remote_timer_id);
+ this.open_remote_timer_id = 0;
}
-
+
// Open the remote connection using a Mutex to prevent concurrency.
//
// start_remote_open_now() *should* prevent more than one open from occurring at the same time,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]