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:
@ -39,6 +39,8 @@ GenericWorkspacesView.prototype = {
|
||||
this.actor = new St.Bin({ style_class: "workspaces" });
|
||||
this._actor = new Clutter.Group();
|
||||
|
||||
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
|
||||
|
||||
this.actor.add_actor(this._actor);
|
||||
this.actor.connect('style-changed', Lang.bind(this,
|
||||
function() {
|
||||
@ -181,13 +183,14 @@ GenericWorkspacesView.prototype = {
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
this.actor.destroy();
|
||||
},
|
||||
|
||||
_onDestroy: function() {
|
||||
for (let w = 0; w < this._workspaces.length; w++)
|
||||
this._workspaces[w].destroy();
|
||||
this._workspaces = [];
|
||||
|
||||
this.actor.destroy();
|
||||
this.actor = null;
|
||||
|
||||
Main.overview.disconnect(this._overviewShowingId);
|
||||
global.screen.disconnect(this._nWorkspacesNotifyId);
|
||||
global.window_manager.disconnect(this._switchWorkspaceNotifyId);
|
||||
|
Reference in New Issue
Block a user