[gnome-shell/wip/rstrode/rhel-7.9: 73/86] appDisplay: Add destroy handler for FolderIcon




commit bd90d5404d9ecb970bf716149f29f5fe8878da10
Author: Ray Strode <rstrode redhat com>
Date:   Mon Jul 22 10:57:57 2019 -0400

    appDisplay: Add destroy handler for FolderIcon
    
    It is important that the FolderView of a FolderIcon always
    gets destroyed before the AppFolderPopup, since the view
    may or may not be in the popup, and the view should
    get cleaned up exactly once in either case.
    
    This commit adds a destroy handler on FolderIcon to ensure
    things get taken down in the right order, and to make sure
    the view isn't leaked if it's not yet part of the popup.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/628

 js/ui/appDisplay.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 756e8ae44f..2392281a2c 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1302,6 +1302,7 @@ var FolderIcon = new Lang.Class({
             this.view.actor.vscroll.adjustment.value = 0;
             this._openSpaceForPopup();
         });
+        this.actor.connect('destroy', this.onDestroy.bind(this));
         this.actor.connect('notify::mapped', () => {
             if (!this.actor.mapped && this._popup)
                 this._popup.popdown();
@@ -1311,6 +1312,13 @@ var FolderIcon = new Lang.Class({
         this._redisplay();
     },
 
+    onDestroy() {
+        this.view.actor.destroy();
+
+        if (this._popup)
+            this._popup.actor.destroy();
+    },
+
     getAppIds() {
         return this.view.getAllItems().map(item => item.id);
     },
@@ -1487,7 +1495,6 @@ var AppFolderPopup = new Lang.Class({
 
         global.focus_manager.add_group(this.actor);
 
-        source.actor.connect('destroy', () => { this.actor.destroy(); });
         this._grabHelper = new GrabHelper.GrabHelper(this.actor);
         this._grabHelper.addActor(Main.layoutManager.overviewGroup);
         this.actor.connect('key-press-event', this._onKeyPress.bind(this));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]