Skip to content

Commit

Permalink
use explicit free for nan buffer to fix issues with electron
Browse files Browse the repository at this point in the history
  • Loading branch information
justadudewhohacks committed Jan 19, 2018
1 parent ac069dd commit 047df17
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cc/core/Mat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,12 @@ struct Mat::GetDataWorker : SimpleWorker {
return "";
}

static void freeBufferCallback(char* data, void* hint) {
free(data);
}

FF_VAL getReturnValue() {
return Nan::NewBuffer(data, size).ToLocalChecked();
return Nan::NewBuffer(data, size, freeBufferCallback, 0).ToLocalChecked();
}
};

Expand Down

0 comments on commit 047df17

Please sign in to comment.