Skip to content

Commit

Permalink
fix: reorganize cleanup logic in extension.ts to fix bug with indicat…
Browse files Browse the repository at this point in the history
…or being destroyed prematurely

- my dumb ass was destroying the indicator during the initialization sequence.
  • Loading branch information
ZanzyTHEbar committed Feb 18, 2025
1 parent 33f280c commit 412148e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions gnome-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,22 @@ export default class VSCodeWorkspacesExtension extends Extension {
}

disable() {
this._cleanup()
this._log(`VSCode Workspaces Extension disabled`);
}


private _cleanup() {
this._cleanup();
if (this._refreshTimeout) {
GLib.source_remove(this._refreshTimeout);
this._refreshTimeout = null;
}

if (this._indicator) {
this._indicator.destroy();
this._indicator = undefined;
}
this.gsettings = undefined;
this._log(`VSCode Workspaces Extension disabled`);
}


private _cleanup() {
// clean up the cache
this._workspaces.clear();
this._recentWorkspaces.clear();
Expand Down Expand Up @@ -203,7 +203,6 @@ export default class VSCodeWorkspacesExtension extends Extension {
this._nofailList = this.gsettings.get_value('nofail-workspaces').deepUnpack() ?? [];
this._customCmdArgs = this.gsettings.get_value('custom-cmd-args').deepUnpack() ?? '';

this._log(`Workspaces Extension enabled`);
this._log(`New Window: ${this._newWindow}`);
this._log(`Workspaces Storage Location: ${this._editorLocation}`);
this._log(`Refresh Interval: ${this._refreshInterval}`);
Expand Down

0 comments on commit 412148e

Please sign in to comment.