From 6a1c7b7588d3b4140b3f7b9b09e3004eae7d0360 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Sat, 16 Sep 2017 20:17:32 +0100 Subject: [PATCH] Ensure input Buffer really is marked as Persistent #950 --- docs/changelog.md | 6 ++++++ package.json | 3 ++- src/common.cc | 2 +- src/common.h | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 1c0f5d2f..cc74d0ce 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -4,6 +4,12 @@ Requires libvips v8.5.5. +#### v0.18.4 - TBD + +* Ensure input Buffer really is marked as Persistent, prevents mark-sweep GC. + [#950](https://github.com/lovell/sharp/issues/950) + [@lfdoherty](https://github.com/lfdoherty) + #### v0.18.3 - 13th September 2017 * Skip shrink-on-load when trimming. diff --git a/package.json b/package.json index 8b5d7f32..8fac5dd6 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,8 @@ "filter": [ "build/c++11", "build/include", - "runtime/indentation_namespace" + "runtime/indentation_namespace", + "runtime/references" ] } } diff --git a/src/common.cc b/src/common.cc index 4b0b5635..024a163d 100644 --- a/src/common.cc +++ b/src/common.cc @@ -40,7 +40,7 @@ namespace sharp { // Create an InputDescriptor instance from a v8::Object describing an input image InputDescriptor* CreateInputDescriptor( - v8::Handle input, std::vector> buffersToPersist + v8::Handle input, std::vector> &buffersToPersist ) { Nan::HandleScope(); InputDescriptor *descriptor = new InputDescriptor; diff --git a/src/common.h b/src/common.h index 1bf3b41c..81946d10 100644 --- a/src/common.h +++ b/src/common.h @@ -89,7 +89,7 @@ namespace sharp { // Create an InputDescriptor instance from a v8::Object describing an input image InputDescriptor* CreateInputDescriptor( - v8::Handle input, std::vector> buffersToPersist); + v8::Handle input, std::vector> &buffersToPersist); enum class ImageType { JPEG,