Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Commit 9cf6ea0

Browse files
committed
add handlescopes to fix potential memory leaks.
1 parent ea5999d commit 9cf6ea0

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace leveldown {
1313
NAN_INLINE bool BooleanOptionValue(v8::Local<v8::Object> options,
1414
const char* _key,
1515
bool def = false) {
16+
Nan::HandleScope scope;
1617
v8::Local<v8::String> key = Nan::New(_key).ToLocalChecked();
1718
return !options.IsEmpty()
1819
&& options->Has(key)
@@ -23,6 +24,7 @@ NAN_INLINE bool BooleanOptionValue(v8::Local<v8::Object> options,
2324
NAN_INLINE uint32_t UInt32OptionValue(v8::Local<v8::Object> options,
2425
const char* _key,
2526
uint32_t def) {
27+
Nan::HandleScope scope;
2628
v8::Local<v8::String> key = Nan::New(_key).ToLocalChecked();
2729
return !options.IsEmpty()
2830
&& options->Has(key)

src/iterator_async.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ void NextWorker::Execute () {
3333
}
3434

3535
void NextWorker::HandleOKCallback () {
36+
Nan::HandleScope scope;
3637
size_t idx = 0;
3738

3839
size_t arraySize = result.size() * 2;

0 commit comments

Comments
 (0)