Browse Source

More locals

v1.x
Tj Holowaychuk 14 years ago
parent
commit
e2df4d491e
  1. 6
      src/Canvas.cc

6
src/Canvas.cc

@ -215,6 +215,7 @@ Canvas::ToBuffer(const Arguments &args) {
static cairo_status_t
streamPNG(void *c, const uint8_t *data, unsigned len) {
HandleScope scope;
closure_t *closure = (closure_t *) c;
Buffer *buf = Buffer::New(len);
#if NODE_VERSION_AT_LEAST(0,3,0)
@ -222,7 +223,10 @@ streamPNG(void *c, const uint8_t *data, unsigned len) {
#else
memcpy(buf->data(), data, len);
#endif
Handle<Value> argv[3] = { Null(), buf->handle_, Integer::New(len) };
Local<Value> argv[3] = {
Local<Value>::New(Null())
, Local<Value>::New(buf->handle_)
, Integer::New(len) };
closure->fn->Call(Context::GetCurrent()->Global(), 3, argv);
return CAIRO_STATUS_SUCCESS;
}

Loading…
Cancel
Save