From e2df4d491e10cb0116e670f69d1450cd82f4e2a9 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Mon, 8 Nov 2010 18:13:22 -0800 Subject: [PATCH] More locals --- src/Canvas.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Canvas.cc b/src/Canvas.cc index b87a175..77971fd 100644 --- a/src/Canvas.cc +++ b/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 argv[3] = { Null(), buf->handle_, Integer::New(len) }; + Local argv[3] = { + Local::New(Null()) + , Local::New(buf->handle_) + , Integer::New(len) }; closure->fn->Call(Context::GetCurrent()->Global(), 3, argv); return CAIRO_STATUS_SUCCESS; }