diff options
Diffstat (limited to 'modules/core/module-manager.js')
| -rw-r--r-- | modules/core/module-manager.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/core/module-manager.js b/modules/core/module-manager.js index 4f004ee..8cecc4d 100644 --- a/modules/core/module-manager.js +++ b/modules/core/module-manager.js @@ -4,8 +4,23 @@ this.terminal = terminal; this.modules = {}; this.moduleRegistry = []; + this._timers = []; // v4.5.68: central timer registry this.loadFromStorage(); } + // v4.5.68: Central timer registry — all modules should use these instead of raw setInterval + _setInterval(fn, ms) { + const id = setInterval(fn, ms); + this._timers.push(id); + return id; + } + _clearTimer(id) { + clearInterval(id); + this._timers = this._timers.filter(t => t !== id); + } + clearAllTimers() { + this._timers.forEach(id => clearInterval(id)); + this._timers = []; + } loadFromStorage() { try { const saved = localStorage.getItem('webx11_modules'); |