|
|
a9802f |
From fd8c4dc073b121b1093d68472cac3292d2c6605c Mon Sep 17 00:00:00 2001
|
|
|
a9802f |
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
|
|
|
a9802f |
Date: Mon, 14 Jun 2021 17:59:39 +0200
|
|
|
a9802f |
Subject: [PATCH] shellEntry: Disconnect handler on destroy
|
|
|
a9802f |
|
|
|
a9802f |
Actors will get unmapped on destroy, so unless we disconnect from
|
|
|
a9802f |
the notify::mapped signal, the handler will run one last time and
|
|
|
a9802f |
try to access methods/properties on the invalidated actor.
|
|
|
a9802f |
---
|
|
|
a9802f |
js/ui/shellEntry.js | 3 ++-
|
|
|
a9802f |
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
a9802f |
|
|
|
a9802f |
diff --git a/js/ui/shellEntry.js b/js/ui/shellEntry.js
|
|
|
a9802f |
index 4a30b22f7..53bd1daa1 100644
|
|
|
a9802f |
--- a/js/ui/shellEntry.js
|
|
|
a9802f |
+++ b/js/ui/shellEntry.js
|
|
|
a9802f |
@@ -186,7 +186,7 @@ class CapsLockWarning extends St.Label {
|
|
|
a9802f |
this._keymap = Clutter.get_default_backend().get_keymap();
|
|
|
a9802f |
this._stateChangedId = 0;
|
|
|
a9802f |
|
|
|
a9802f |
- this.connect('notify::mapped', () => {
|
|
|
a9802f |
+ const mappedId = this.connect('notify::mapped', () => {
|
|
|
a9802f |
if (this.is_mapped()) {
|
|
|
a9802f |
this._stateChangedId = this._keymap.connect('state-changed',
|
|
|
a9802f |
() => this._sync(true));
|
|
|
a9802f |
@@ -201,6 +201,7 @@ class CapsLockWarning extends St.Label {
|
|
|
a9802f |
this.connect('destroy', () => {
|
|
|
a9802f |
if (this._stateChangedId)
|
|
|
a9802f |
this._keymap.disconnect(this._stateChangedId);
|
|
|
a9802f |
+ this.disconnect(mappedId);
|
|
|
a9802f |
});
|
|
|
a9802f |
}
|
|
|
a9802f |
|
|
|
a9802f |
--
|
|
|
a9802f |
2.31.1
|
|
|
a9802f |
|