Skip to content

Commit 0d01301

Browse files
authored
Merge pull request #291 from pobrn/dont_leak_WorkspaceThumbnails
Don't leak WorkspaceThumbnail objects
2 parents 85bcdbe + 92d1e6c commit 0d01301

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

[email protected]/workspacePopup/workspaceSwitcherPopup.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ class WorkspaceSwitcherPopup extends SwitcherPopup {
195195
while (modals.length > 0) {
196196
modals.pop().destroy();
197197
}
198+
199+
this._items.forEach((x) => x.destroy());
200+
this._items = [];
198201
}
199202

200203
vfunc_allocate(box) {

[email protected]/workspacePopup/workspaceSwitcherPopupList.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ export default GObject.registerClass({
4242
style: `spacing: ${ITEM_SPACING}`,
4343
});
4444
this._lists = [];
45-
this._thumbnails = thumbnails;
46-
this._workspaceName = workspaceName;
4745
this._scale = options.scale;
4846
this._showThumbnails = options.showThumbnails;
4947
this._showWorkspaceName = options.showWorkspaceNames;
@@ -75,7 +73,7 @@ export default GObject.registerClass({
7573
() => this.highlight(workspaceManager.get_active_workspace_index()));
7674

7775
for (let i = 0; i < thumbnails.length; i++) {
78-
this.addItem(this._thumbnails[i], this._workspaceName[i]);
76+
this.addItem(thumbnails[i], workspaceName[i]);
7977
}
8078
}
8179

0 commit comments

Comments
 (0)