LookingGlass: fix a Clutter warning

After destroying an actor, it is no more parented anywhere, so we
cannot allocate it.

https://bugzilla.gnome.org/show_bug.cgi?id=633028
This commit is contained in:
Giovanni Campagna 2011-01-11 21:14:16 +01:00
parent 00d897f282
commit 856207c154

View File

@ -398,6 +398,9 @@ Inspector.prototype = {
}, },
_allocate: function(actor, box, flags) { _allocate: function(actor, box, flags) {
if (!this._eventHandler)
return;
let primary = global.get_primary_monitor(); let primary = global.get_primary_monitor();
let [minWidth, minHeight, natWidth, natHeight] = let [minWidth, minHeight, natWidth, natHeight] =
@ -415,6 +418,7 @@ Inspector.prototype = {
Clutter.ungrab_pointer(this._eventHandler); Clutter.ungrab_pointer(this._eventHandler);
Clutter.ungrab_keyboard(this._eventHandler); Clutter.ungrab_keyboard(this._eventHandler);
this._eventHandler.destroy(); this._eventHandler.destroy();
this._eventHandler = null;
this.emit('closed'); this.emit('closed');
}, },