Permalink
Browse files

Merge branch 'memleaks'

  • Loading branch information...
2 parents 285dc4f + 7831d74 commit 922cd79673fe9786045b2943b1ebdb72dc762b02 @kkoopa kkoopa committed Dec 7, 2013
Showing with 12 additions and 12 deletions.
  1. +1 −1 binding.gyp
  2. +1 −1 package.json
  3. +4 −4 src/Canvas.cc
  4. +6 −6 src/JPEGStream.h
View
2 binding.gyp
@@ -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',
View
2 package.json
@@ -9,7 +9,7 @@
"test": "make test"
}
, "dependencies": {
- "nan": "~0.4.1"
+ "nan": "~0.6.0"
}
, "devDependencies": {
"express": "3.0"
View
8 src/Canvas.cc
@@ -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);
}
@@ -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);
@@ -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);
}
View
12 src/JPEGStream.h
@@ -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);
@@ -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)
};

0 comments on commit 922cd79

Please sign in to comment.