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
This commit is contained in:
Giovanni Campagna 2010-10-28 22:28:17 +02:00
parent 08f7ecad35
commit a19e8d58f5

View File

@ -155,20 +155,24 @@ PopupBaseMenuItem.prototype = {
this._children.push({ actor: child, this._children.push({ actor: child,
column: column, column: column,
span: span }); 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); this.actor.add_actor(child);
}, },
removeActor: function(child) { _removeChild: function(child) {
for (let i = 0; i < this._children.length; i++) { for (let i = 0; i < this._children.length; i++) {
if (this._children[i].actor == child) { if (this._children[i].actor == child) {
this._children.splice(i, 1); this._children.splice(i, 1);
this.actor.remove_actor(child);
return; return;
} }
} }
}, },
removeActor: function(child) {
this.actor.remove_actor(child);
this._removeChild(child);
},
setShowDot: function(show) { setShowDot: function(show) {
if (show) { if (show) {
if (this._dot) if (this._dot)