mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Added release function to attempt to explicitly free mat memory
This commit is contained in:
parent
2ddb97047e
commit
1eeae7879c
@ -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", 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();
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user