From e5f47064bf7f51d63d8538b9e5a3f5c7a741158a Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 9 Mar 2015 16:09:55 -0700 Subject: [PATCH] Fixed segfault by fixing scope issue --- src/node/ext/byte_buffer.cc | 2 +- src/node/ext/completion_queue_async_worker.cc | 1 - src/node/test/math_client_test.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/node/ext/byte_buffer.cc b/src/node/ext/byte_buffer.cc index 5235c8e083d..82b54b518c0 100644 --- a/src/node/ext/byte_buffer.cc +++ b/src/node/ext/byte_buffer.cc @@ -65,7 +65,7 @@ grpc_byte_buffer *BufferToByteBuffer(Handle buffer) { Handle ByteBufferToBuffer(grpc_byte_buffer *buffer) { NanEscapableScope(); if (buffer == NULL) { - return NanNull(); + return NanEscapeScope(NanNull()); } size_t length = grpc_byte_buffer_length(buffer); char *result = reinterpret_cast(calloc(length, sizeof(char))); diff --git a/src/node/ext/completion_queue_async_worker.cc b/src/node/ext/completion_queue_async_worker.cc index ca22527e6f5..cd7acd1d1b1 100644 --- a/src/node/ext/completion_queue_async_worker.cc +++ b/src/node/ext/completion_queue_async_worker.cc @@ -80,7 +80,6 @@ void CompletionQueueAsyncWorker::HandleOKCallback() { NanScope(); NanCallback *callback = GetTagCallback(result->tag); Handle argv[] = {NanNull(), GetTagNodeValue(result->tag)}; - callback->Call(2, argv); DestroyTag(result->tag); diff --git a/src/node/test/math_client_test.js b/src/node/test/math_client_test.js index b9155fdfa86..d83f64116f7 100644 --- a/src/node/test/math_client_test.js +++ b/src/node/test/math_client_test.js @@ -81,7 +81,7 @@ describe('Math client', function() { done(); }); }); - it.only('should handle a client streaming request', function(done) { + it('should handle a client streaming request', function(done) { var call = math_client.sum(function handleSumResult(err, value) { assert.ifError(err); assert.equal(value.num, 21);