summaryrefslogtreecommitdiff
path: root/src/handle_wrap.cc
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2013-09-05 15:50:51 -0700
committerTrevor Norris <trev.norris@gmail.com>2013-09-05 15:56:34 -0700
commitf218d94af4a7f70086c931be01b1bed9c76bfee0 (patch)
tree28ee278c67411b40396c0a0a3d90bd54f4a8947e /src/handle_wrap.cc
parent6df4741f840832886716145cf81654d5a0a9e2e0 (diff)
downloadandroid-node-v8-f218d94af4a7f70086c931be01b1bed9c76bfee0.tar.gz
android-node-v8-f218d94af4a7f70086c931be01b1bed9c76bfee0.tar.bz2
android-node-v8-f218d94af4a7f70086c931be01b1bed9c76bfee0.zip
handle_wrap: properly don't abort on unwrap
From commit 756ae2c all the WRAP/UNWRAP were moved to a single location for ease of use. In a single location NO_ABORT should have been used but wasn't. This caused HandleWrap::Close to abort. Below is the applicable code change as demonstration there was no abort specified when unwrapping the object. void HandleWrap::Close(const FunctionCallbackInfo<Value>& args) { HandleScope scope(node_isolate); - HandleWrap *wrap = static_cast<HandleWrap*>( - args.This()->GetAlignedPointerFromInternalField(0)); + HandleWrap* wrap; + UNWRAP(args.This(), HandleWrap, wrap); Also included a test that will reproduce the abort.
Diffstat (limited to 'src/handle_wrap.cc')
-rw-r--r--src/handle_wrap.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc
index 4aba0efc4d..858b55cdd4 100644
--- a/src/handle_wrap.cc
+++ b/src/handle_wrap.cc
@@ -68,7 +68,7 @@ void HandleWrap::Close(const FunctionCallbackInfo<Value>& args) {
HandleScope scope(node_isolate);
HandleWrap* wrap;
- NODE_UNWRAP(args.This(), HandleWrap, wrap);
+ NODE_UNWRAP_NO_ABORT(args.This(), HandleWrap, wrap);
// guard against uninitialized handle or double close
if (wrap == NULL || wrap->handle__ == NULL) return;