Use _onDestroy() handlers for cleanup in delegates

Unify the style of <delegate>.destroy() methods to only contain a
call to <delegate>.actor.destroy() and handle additional cleanup
in a _onDestroy() signal handler.

https://bugzilla.gnome.org/show_bug.cgi?id=609454
This commit is contained in:
Florian Müllner
2010-02-18 16:43:58 +01:00
parent 0770fd5be5
commit 9f43ed3f95
3 changed files with 25 additions and 12 deletions

View File

@ -581,6 +581,9 @@ Workspace.prototype = {
this.actor = new Clutter.Group();
this.actor._delegate = this;
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
// Auto-sizing is unreliable in the presence of ClutterClone, so rather than
// implicitly counting on the workspace actor to be sized to the size of the
// included desktop actor clone, set the size explicitly to the screen size.
@ -1330,10 +1333,11 @@ Workspace.prototype = {
},
destroy : function() {
Tweener.removeTweens(this.actor);
this.actor.destroy();
this.actor = null;
this._windowOverlaysGroup.destroy();
},
_onDestroy: function(actor) {
Tweener.removeTweens(actor);
this._metaWorkspace.disconnect(this._windowAddedId);
this._metaWorkspace.disconnect(this._windowRemovedId);