Create a HandleScope before calling callbacks
This commit is contained in:
parent
2eacb66ac4
commit
5ecf13c261
|
@ -16,6 +16,8 @@
|
||||||
//
|
//
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include <nan.h>
|
||||||
|
|
||||||
#include "impl/weak_realm_notifier.hpp"
|
#include "impl/weak_realm_notifier.hpp"
|
||||||
|
|
||||||
#include "shared_realm.hpp"
|
#include "shared_realm.hpp"
|
||||||
|
@ -35,6 +37,8 @@ WeakRealmNotifier::WeakRealmNotifier(const std::shared_ptr<Realm>& realm, bool c
|
||||||
auto realm = realm_weak_ptr->lock();
|
auto realm = realm_weak_ptr->lock();
|
||||||
|
|
||||||
if (realm) {
|
if (realm) {
|
||||||
|
// The v8::Local handles need a "scope" to be present or will crash.
|
||||||
|
Nan::HandleScope scope;
|
||||||
realm->notify();
|
realm->notify();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue