Skip to content

Commit

Permalink
Merge branch 'memleaks'
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoopa committed Dec 7, 2013
2 parents 285dc4f + 7831d74 commit 922cd79
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion binding.gyp
Expand Up @@ -21,7 +21,7 @@
'targets': [
{
'target_name': 'canvas',
'include_dirs': ["<!(node -p -e \"require('path').relative('.', require('path').dirname(require.resolve('nan')))\")"],
'include_dirs': ["<!(node -e \"require('nan')\")"],
'sources': [
'src/Canvas.cc',
'src/CanvasGradient.cc',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -9,7 +9,7 @@
"test": "make test"
}
, "dependencies": {
"nan": "~0.4.1"
"nan": "~0.6.0"
}
, "devDependencies": {
"express": "3.0"
Expand Down
8 changes: 4 additions & 4 deletions src/Canvas.cc
Expand Up @@ -211,7 +211,7 @@ Canvas::EIO_AfterToBuffer(eio_req *req) {
} else {
Local<Object> buf = NanNewBufferHandle((char*)closure->data, closure->len);
memcpy(Buffer::Data(buf), closure->data, closure->len);
Local<Value> argv[2] = { Local<Value>::New(Null()), buf };
Local<Value> argv[2] = { NanNewLocal<Value>(Null()), buf };
closure->pfn->Call(2, argv);
}

Expand Down Expand Up @@ -348,7 +348,7 @@ streamPNG(void *c, const uint8_t *data, unsigned len) {
closure_t *closure = (closure_t *) c;
Local<Object> buf = NanNewBufferHandle((char *)data, len);
Local<Value> argv[3] = {
Local<Value>::New(Null())
NanNewLocal<Value>(Null())
, buf
, Integer::New(len) };
MakeCallback(Context::GetCurrent()->Global(), closure->fn, 3, argv);
Expand Down Expand Up @@ -423,8 +423,8 @@ NAN_METHOD(Canvas::StreamPNGSync) {
MakeCallback(Context::GetCurrent()->Global(), closure.fn, 1, argv);
} else {
Local<Value> argv[3] = {
Local<Value>::New(Null())
, Local<Value>::New(Null())
NanNewLocal<Value>(Null())
, NanNewLocal<Value>(Null())
, Integer::New(0) };
MakeCallback(Context::GetCurrent()->Global(), closure.fn, 3, argv);
}
Expand Down
12 changes: 6 additions & 6 deletions src/JPEGStream.h
Expand Up @@ -34,8 +34,8 @@ empty_closure_output_buffer(j_compress_ptr cinfo){
closure_destination_mgr *dest = (closure_destination_mgr *) cinfo->dest;
Local<Object> buf = NanNewBufferHandle((char *)dest->buffer, dest->bufsize);
Local<Value> argv[3] = {
Local<Value>::New(Null())
, Local<Value>::New(buf)
NanNewLocal<Value>(Null())
, NanNewLocal<Value>(buf)
, Integer::New(dest->bufsize)
};
dest->closure->fn->Call(Context::GetCurrent()->Global(), 3, argv);
Expand All @@ -53,17 +53,17 @@ term_closure_destination(j_compress_ptr cinfo){
Local<Object> buf = NanNewBufferHandle((char *)dest->buffer, remaining);

Local<Value> data_argv[3] = {
Local<Value>::New(Null())
, Local<Value>::New(buf)
NanNewLocal<Value>(Null())
, NanNewLocal<Value>(buf)
, Integer::New(remaining)
};

dest->closure->fn->Call(Context::GetCurrent()->Global(), 3, data_argv);

// emit "end"
Local<Value> end_argv[3] = {
Local<Value>::New(Null())
, Local<Value>::New(Null())
NanNewLocal<Value>(Null())
, NanNewLocal<Value>(Null())
, Integer::New(0)
};

Expand Down

0 comments on commit 922cd79

Please sign in to comment.