diff --git a/index.js b/index.js index e441fbe9..44ffc6bb 100644 --- a/index.js +++ b/index.js @@ -388,7 +388,6 @@ module.exports = class Autobase extends ReadyResource { async _closeLocalCores () { const closing = [] - if (this.system) closing.push(this.system.close()) if (this._primaryBootstrap) closing.push(this._primaryBootstrap.close()) if (this.localWriter) closing.push(this._unsetLocalWriter()) closing.push(this._closeAllActiveWriters()) diff --git a/lib/apply-state.js b/lib/apply-state.js index 3f975ce9..f40f1d7b 100644 --- a/lib/apply-state.js +++ b/lib/apply-state.js @@ -464,6 +464,7 @@ module.exports = class ApplyState extends ReadyResource { this.interrupted = true for (const chk of this.checkpoints) await chk.close() if (this.base._hasClose) await this.base._handlers.close(this.view) + if (this.system) await this.system.close() const promises = [] for (const v of this.views) {