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

Commit

Permalink
add handlescopes to fix potential memory leaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed Mar 24, 2016
1 parent ea5999d commit 9cf6ea0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace leveldown {
NAN_INLINE bool BooleanOptionValue(v8::Local<v8::Object> options,
const char* _key,
bool def = false) {
Nan::HandleScope scope;
v8::Local<v8::String> key = Nan::New(_key).ToLocalChecked();
return !options.IsEmpty()
&& options->Has(key)
Expand All @@ -23,6 +24,7 @@ NAN_INLINE bool BooleanOptionValue(v8::Local<v8::Object> options,
NAN_INLINE uint32_t UInt32OptionValue(v8::Local<v8::Object> options,
const char* _key,
uint32_t def) {
Nan::HandleScope scope;
v8::Local<v8::String> key = Nan::New(_key).ToLocalChecked();
return !options.IsEmpty()
&& options->Has(key)
Expand Down
1 change: 1 addition & 0 deletions src/iterator_async.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ void NextWorker::Execute () {
}

void NextWorker::HandleOKCallback () {
Nan::HandleScope scope;
size_t idx = 0;

size_t arraySize = result.size() * 2;
Expand Down

0 comments on commit 9cf6ea0

Please sign in to comment.