[gnome-shell/wip/rstrode/login-screen-extensions: 80/134] appDisplay: Stop watching FolderIcon parent view when destroyed
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/rstrode/login-screen-extensions: 80/134] appDisplay: Stop watching FolderIcon parent view when destroyed
- Date: Thu, 26 Aug 2021 19:31:00 +0000 (UTC)
commit c34b4a8f5e0ff36103b23b4121cb5f966978810c
Author: Ray Strode <rstrode redhat com>
Date: Thu Jul 18 14:49:30 2019 -0400
appDisplay: Stop watching FolderIcon parent view when destroyed
When a FolderIcon is opened, it asks the parent view to allocate
space for it, which takes time. Eventually, the space-ready
signal is emitted on the view and the icon can make use of the new
space with its popup. If the icon gets destroyed in the
interim, though, space-ready signal handler still fires.
This commit disconnects the signal handler so it doesn't get called
on a destroyed icon.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/628
js/ui/appDisplay.js | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 5a8f4f1bf5..062ff222c4 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1169,6 +1169,11 @@ var FolderIcon = class FolderIcon {
onDestroy() {
this.view.actor.destroy();
+ if (this._spaceReadySignalId) {
+ this._parentView.disconnect(this._spaceReadySignalId);
+ this._spaceReadySignalId = 0;
+ }
+
if (this._popup)
this._popup.actor.destroy();
}
@@ -1240,8 +1245,9 @@ var FolderIcon = class FolderIcon {
}
_openSpaceForPopup() {
- let id = this._parentView.connect('space-ready', () => {
- this._parentView.disconnect(id);
+ this._spaceReadySignalId = this._parentView.connect('space-ready', () => {
+ this._parentView.disconnect(this._spaceReadySignalId);
+ this._spaceReadySignalId = 0;
this._popup.popup();
this._updatePopupPosition();
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]