From: Cheng Zhao Date: Fri, 27 Dec 2013 06:47:50 +0000 (+0800) Subject: Fix crash when calling method of destroyed object. X-Git-Tag: v0.8.0~1^2~3 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=1701f572e2f29b27958bfdb63ea74718ad741532;p=electron.git Fix crash when calling method of destroyed object. --- diff --git a/browser/api/atom_api_event_emitter.cc b/browser/api/atom_api_event_emitter.cc index c550cfc9..15dc5dde 100644 --- a/browser/api/atom_api_event_emitter.cc +++ b/browser/api/atom_api_event_emitter.cc @@ -21,6 +21,10 @@ EventEmitter::EventEmitter(v8::Handle wrapper) { } 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) {