Merge pull request #270 from Queuecumber/master

Explicit Memory Management
This commit is contained in:
Peter Braden 2015-07-23 17:37:21 +02:00
commit 8be40fc269
2 changed files with 14 additions and 0 deletions

View File

@ -101,6 +101,7 @@ Matrix::Init(Handle<Object> 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<Matrix>(args.This());
self->mat.release();
NanReturnUndefined();
}

View File

@ -115,6 +115,8 @@ class Matrix: public node::ObjectWrap {
JSFUNC(SetWithMask)
JSFUNC(MeanWithMask)
JSFUNC(Shift)
JSFUNC(Release)
/*
static Handle<Value> Val(const Arguments& args);
static Handle<Value> RowRange(const Arguments& args);