Fix crash when calling method of destroyed object.
This commit is contained in:
parent
15a9be6b93
commit
1701f572e2
1 changed files with 4 additions and 0 deletions
|
@ -21,6 +21,10 @@ EventEmitter::EventEmitter(v8::Handle<v8::Object> wrapper) {
|
||||||
}
|
}
|
||||||
|
|
||||||
EventEmitter::~EventEmitter() {
|
EventEmitter::~EventEmitter() {
|
||||||
|
// Clear the aligned pointer, it should have been done by ObjectWrap but
|
||||||
|
// somehow node v0.11.x changed this behaviour.
|
||||||
|
v8::HandleScope handle_scope(node_isolate);
|
||||||
|
handle()->SetAlignedPointerInInternalField(0, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EventEmitter::Emit(const std::string& name) {
|
bool EventEmitter::Emit(const std::string& name) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue