[geary/wip/747627-drafts-not-saved-0.11: 15/16] Fix ComposerWidget never being finalised.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/747627-drafts-not-saved-0.11: 15/16] Fix ComposerWidget never being finalised.
- Date: Thu, 15 Dec 2016 00:31:04 +0000 (UTC)
commit f9470ae2bc5b1c1fc9f6782a0e555d06f43e566e
Author: Michael James Gratton <mike vee net>
Date: Tue Sep 20 22:17:51 2016 +1000
Fix ComposerWidget never being finalised.
* src/client/composer/composer-widget.vala (ComposerWidget): Closure for
conversation_viewer signal handler somehow kept a reference that wasn't
an issue if the closure didn't include the viewer instance??
src/client/composer/composer-widget.vala | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index 62c502d..deec781 100644
--- a/src/client/composer/composer-widget.vala
+++ b/src/client/composer/composer-widget.vala
@@ -615,14 +615,19 @@ public class ComposerWidget : Gtk.EventBox {
chain.append(attachments_box);
box.set_focus_chain(chain);
- // Remind the conversation viewer of draft ids when it reloads
+ // Remind the conversation viewer of draft ids when it
+ // reloads. Need to use the signal handler's viewer instance
+ // to avoid some sort of ref that is preventing the composer
+ // from being finalised when closed.
ConversationViewer conversation_viewer =
GearyApplication.instance.controller.main_window.conversation_viewer;
- conversation_viewer.cleared.connect(() => {
+ conversation_viewer.cleared.connect((viewer) => {
if (draft_manager != null)
- conversation_viewer.blacklist_by_id(draft_manager.current_draft_id);
+ viewer.blacklist_by_id(draft_manager.current_draft_id);
});
-
+
+ // Don't do this in an overridden version of the destroy
+ // method, it somehow ends up in an infinite loop
destroy.connect(() => { close_draft_manager_async.begin(null); });
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]