[polari/wip/fmuellner/invalid-object-access: 1/10] connectionProperties: Disconnect account signals
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/invalid-object-access: 1/10] connectionProperties: Disconnect account signals
- Date: Sun, 10 Dec 2017 15:18:13 +0000 (UTC)
commit 0b780928165c861d608e567c148b98920115b0e1
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Dec 6 01:20:44 2017 +0100
connectionProperties: Disconnect account signals
Accounts clearly have a longer life time than the dialog, so we need
to disconnect any handlers to not leak the signal connection.
https://gitlab.gnome.org/GNOME/polari/issues/32
src/connections.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/connections.js b/src/connections.js
index aecbdd5..5d04388 100644
--- a/src/connections.js
+++ b/src/connections.js
@@ -498,9 +498,11 @@ var ConnectionProperties = GObject.registerClass({
});
this.set_default_response(Gtk.ResponseType.OK);
- account.connect('notify::connection-status',
- this._syncErrorMessage.bind(this));
+ let id = account.connect('notify::connection-status',
+ this._syncErrorMessage.bind(this));
this._syncErrorMessage(account);
+
+ this.connect('destroy', () => { account.disconnect(id); });
}
_syncErrorMessage(account) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]