MCPcopy
hub / github.com/callumalpass/tasknotes / destroy

Method destroy

src/ui/StatusBarService.ts:499–521  ·  view source on GitHub ↗

* Cleanup when service is destroyed

()

Source from the content-addressed store, hash-verified

497 * Cleanup when service is destroyed
498 */
499 destroy(): void {
500 if (this.updateTimeout) {
501 window.clearTimeout(this.updateTimeout);
502 this.updateTimeout = null;
503 }
504 if (this.pomodoroUpdateTimeout) {
505 window.clearTimeout(this.pomodoroUpdateTimeout);
506 this.pomodoroUpdateTimeout = null;
507 }
508 this.stopElapsedTicker();
509 if (this.plugin.emitter?.offref) {
510 this.pomodoroEventRefs.forEach((ref) => this.plugin.emitter.offref(ref));
511 }
512 this.pomodoroEventRefs = [];
513
514 if (this.requestDeduplicator) {
515 this.requestDeduplicator.cancelAll();
516 }
517
518 // Status bar element is automatically cleaned up by Obsidian when plugin unloads
519 this.statusBarElement = null;
520 this.pomodoroStatusBarElement = null;
521 }
522}

Callers

nothing calls this directly

Calls 4

stopElapsedTickerMethod · 0.95
cancelAllMethod · 0.80
clearTimeoutMethod · 0.65
offrefMethod · 0.65

Tested by

no test coverage detected