diff --git a/src/Canvas.cc b/src/Canvas.cc index 83bb995..2694a6f 100644 --- a/src/Canvas.cc +++ b/src/Canvas.cc @@ -59,8 +59,9 @@ Canvas::New(const Arguments &args) { Handle Canvas::GetWidth(Local prop, const AccessorInfo &info) { + HandleScope scope; Canvas *canvas = ObjectWrap::Unwrap(info.This()); - return Number::New(canvas->width); + return scope.Close(Number::New(canvas->width)); } /* @@ -82,8 +83,9 @@ Canvas::SetWidth(Local prop, Local val, const AccessorInfo &info) Handle Canvas::GetHeight(Local prop, const AccessorInfo &info) { + HandleScope scope; Canvas *canvas = ObjectWrap::Unwrap(info.This()); - return Number::New(canvas->height); + return scope.Close(Number::New(canvas->height)); } /* @@ -299,6 +301,7 @@ Canvas::resurface(Handle canvas) { // Re-surface cairo_surface_destroy(_surface); _surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height); + V8::AdjustAmountOfExternalAllocatedMemory(-4 * width * height); // Reset context Handle context = canvas->Get(String::New("context"));