[gnome-shell] Do not remove destroyed actors from their container



commit a19e8d58f5d30f82f97a79ffe007143a627ac3e5
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Thu Oct 28 22:28:17 2010 +0200

    Do not remove destroyed actors from their container
    
    The container already connects to destroy and will do that for us,
    preventing a warning.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=633028

 js/ui/popupMenu.js |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index f572e13..51b2989 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -155,20 +155,24 @@ PopupBaseMenuItem.prototype = {
         this._children.push({ actor: child,
                               column: column,
                               span: span });
-        this.actor.connect('destroy', Lang.bind(this, function () { this.removeActor(child); }));
+        this.actor.connect('destroy', Lang.bind(this, function () { this._removeChild(child); }));
         this.actor.add_actor(child);
     },
 
-    removeActor: function(child) {
+    _removeChild: function(child) {
         for (let i = 0; i < this._children.length; i++) {
             if (this._children[i].actor == child) {
                 this._children.splice(i, 1);
-                this.actor.remove_actor(child);
                 return;
             }
         }
     },
 
+    removeActor: function(child) {
+        this.actor.remove_actor(child);
+        this._removeChild(child);
+    },
+
     setShowDot: function(show) {
         if (show) {
             if (this._dot)



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