diff --git a/src/Matrix.cc b/src/Matrix.cc index 9ce18f3..a00b01e 100755 --- a/src/Matrix.cc +++ b/src/Matrix.cc @@ -101,6 +101,7 @@ Matrix::Init(Handle target) { NODE_SET_PROTOTYPE_METHOD(ctor, "setWithMask", SetWithMask); NODE_SET_PROTOTYPE_METHOD(ctor, "meanWithMask", MeanWithMask); NODE_SET_PROTOTYPE_METHOD(ctor, "shift", Shift); + NODE_SET_PROTOTYPE_METHOD(ctor, "release", Release); target->Set(NanNew("Matrix"), ctor->GetFunction()); }; @@ -2253,3 +2254,14 @@ NAN_METHOD(Matrix::Shift){ NanReturnUndefined(); } + +NAN_METHOD(Matrix::Release) +{ + NanScope(); + + Matrix *self = ObjectWrap::Unwrap(args.This()); + + self->mat.release(); + + NanReturnUndefined(); +} diff --git a/src/Matrix.h b/src/Matrix.h index fe24ebc..835baec 100755 --- a/src/Matrix.h +++ b/src/Matrix.h @@ -115,6 +115,8 @@ class Matrix: public node::ObjectWrap { JSFUNC(SetWithMask) JSFUNC(MeanWithMask) JSFUNC(Shift) + + JSFUNC(Release) /* static Handle Val(const Arguments& args); static Handle RowRange(const Arguments& args);