Skip to content

Commit

Permalink
Add explicit Local<> scope for wrapper construction
Browse files Browse the repository at this point in the history
  • Loading branch information
saper committed Aug 19, 2015
1 parent 8420fd9 commit 4ed4739
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/callback_bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ CallbackBridge<T, L>::CallbackBridge(Nan::Callback* callback, bool is_sync) : ca
* This is invoked from the main JavaScript thread.
* V8 context is available.
*/
Nan::HandleScope scope;
if (!is_sync) {
this->async = new uv_async_t;
this->async->data = (void*) this;
Expand Down Expand Up @@ -180,6 +181,7 @@ NAN_METHOD(CallbackBridge<T COMMA L>::ReturnCallback) {

template <typename T, typename L>
Nan::MaybeLocal<v8::Function> CallbackBridge<T, L>::get_wrapper_constructor() {
/* Uses handle scope created in the CallbackBridge<T, L> constructor */
if (wrapper_constructor.IsEmpty()) {
v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(New);
tpl->SetClassName(Nan::New("CallbackBridge").ToLocalChecked());
Expand Down

0 comments on commit 4ed4739

Please sign in to comment.