aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-09-14 13:53:07 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-09-14 16:45:20 -0700
commit474f53b13835b5f42e0ef86947497eba28b45441 (patch)
tree5bd753926cb4ee0cc368459d7397c15dc2307faf
parente8659971a9cedeccb90d39d2dfe784048baa2f19 (diff)
Fixed Op destructors not being called
-rw-r--r--src/node/ext/call.cc5
-rw-r--r--src/node/ext/call.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/node/ext/call.cc b/src/node/ext/call.cc
index 560869e6fa..49b306202b 100644
--- a/src/node/ext/call.cc
+++ b/src/node/ext/call.cc
@@ -172,6 +172,9 @@ Handle<Value> Op::GetOpType() const {
return NanEscapeScope(NanNew<String>(GetTypeString()));
}
+Op::~Op() {
+}
+
class SendMetadataOp : public Op {
public:
Handle<Value> GetNodeValue() const {
@@ -325,7 +328,7 @@ class ReadMessageOp : public Op {
}
~ReadMessageOp() {
if (recv_message != NULL) {
- gpr_free(recv_message);
+ grpc_byte_buffer_destroy(recv_message);
}
}
Handle<Value> GetNodeValue() const {
diff --git a/src/node/ext/call.h b/src/node/ext/call.h
index 89f81dcf4d..a01f03489e 100644
--- a/src/node/ext/call.h
+++ b/src/node/ext/call.h
@@ -88,6 +88,7 @@ struct Resources {
class Op {
public:
+ virtual ~Op();
virtual v8::Handle<v8::Value> GetNodeValue() const = 0;
virtual bool ParseOp(v8::Handle<v8::Value> value, grpc_op *out,
shared_ptr<Resources> resources) = 0;
@@ -98,7 +99,6 @@ class Op {
};
typedef std::vector<unique_ptr<Op>> OpVec;
-
struct tag {
tag(NanCallback *callback, OpVec *ops,
shared_ptr<Resources> resources);