Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
Fix race condition due to mutated _getDBs/_putDBs
Browse files Browse the repository at this point in the history
  • Loading branch information
federicobond committed Dec 26, 2017
1 parent d3baf12 commit ffa0c17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions checkpoint-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function _enterCpMode () {
this._scratch = levelup('', {
db: memdown
})
this._getDBs.unshift(this._scratch)
this._getDBs = [this._scratch].concat(this._getDBs)
this.__putDBs = this._putDBs
this._putDBs = [this._scratch]
this._putRaw = this.putRaw
Expand All @@ -105,7 +105,7 @@ function _exitCpMode (commitState, cb) {
var self = this
var scratch = this._scratch
this._scratch = null
this._getDBs.shift()
this._getDBs = this._getDBs.slice(1)
this._putDBs = this.__putDBs
this.putRaw = this._putRaw

Expand Down

0 comments on commit ffa0c17

Please sign in to comment.