diff --git a/src/Matrix.cc b/src/Matrix.cc index 9ce18f3..3308ba4 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", Dispose); target->Set(NanNew("Matrix"), ctor->GetFunction()); }; @@ -2253,3 +2254,12 @@ NAN_METHOD(Matrix::Shift){ NanReturnUndefined(); } + +NAN_METHOD(Matrix::Release) +{ + SETUP_FUNCTION(Matrix) + + 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);