From 57dfd058510d1a3be0ce315ff51fb9f793befd64 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 13 Feb 2015 10:41:25 -0800 Subject: [PATCH] Further improved memory management --- src/node/ext/call.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/ext/call.cc b/src/node/ext/call.cc index 4d719802fc7..e6701efbd4b 100644 --- a/src/node/ext/call.cc +++ b/src/node/ext/call.cc @@ -525,7 +525,6 @@ NAN_METHOD(Call::StartBatch) { return NanThrowError("startBatch's second argument must be a callback"); } Handle callback_func = args[1].As(); - NanCallback *callback = new NanCallback(callback_func); Call *call = ObjectWrap::Unwrap(args.This()); shared_ptr resources(new Resources); Handle obj = args[0]->ToObject(); @@ -574,6 +573,7 @@ NAN_METHOD(Call::StartBatch) { } op_vector->push_back(std::move(op)); } + NanCallback *callback = new NanCallback(callback_func); grpc_call_error error = grpc_call_start_batch( call->wrapped_call, &ops[0], nops, new struct tag( callback, op_vector, resources));