@nxtedition/rocksdb 12.0.3 → 12.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chained-batch.js +8 -4
- package/iterator.js +5 -6
- package/package.json +1 -1
package/chained-batch.js
CHANGED
|
@@ -83,14 +83,18 @@ class ChainedBatch extends AbstractChainedBatch {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
_close (callback) {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
binding.batch_clear(this[kBatchContext])
|
|
89
|
-
this[kBatchContext] = null
|
|
86
|
+
this._closeSync()
|
|
90
87
|
|
|
91
88
|
process.nextTick(callback)
|
|
92
89
|
}
|
|
93
90
|
|
|
91
|
+
_closeSync () {
|
|
92
|
+
if (this[kBatchContext]) {
|
|
93
|
+
binding.batch_clear(this[kBatchContext])
|
|
94
|
+
this[kBatchContext] = null
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
94
98
|
get length () {
|
|
95
99
|
assert(this[kBatchContext])
|
|
96
100
|
|
package/iterator.js
CHANGED
|
@@ -114,8 +114,6 @@ class Iterator extends AbstractIterator {
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
_close (callback) {
|
|
117
|
-
assert(this[kContext])
|
|
118
|
-
|
|
119
117
|
try {
|
|
120
118
|
this._closeSync()
|
|
121
119
|
process.nextTick(callback)
|
|
@@ -125,11 +123,12 @@ class Iterator extends AbstractIterator {
|
|
|
125
123
|
}
|
|
126
124
|
|
|
127
125
|
_closeSync () {
|
|
128
|
-
assert(this[kContext])
|
|
129
|
-
|
|
130
126
|
this[kCache] = kEmpty
|
|
131
|
-
|
|
132
|
-
this[kContext]
|
|
127
|
+
|
|
128
|
+
if (this[kContext]) {
|
|
129
|
+
binding.iterator_close(this[kContext])
|
|
130
|
+
this[kContext] = null
|
|
131
|
+
}
|
|
133
132
|
}
|
|
134
133
|
|
|
135
134
|
_end (callback) {
|