From 0b6a0463a43a37c47c4edc60495bf0914667e667 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 8 Mar 2025 16:00:26 +0300 Subject: [PATCH] Save a reference to the buffer during write --- node-binding/client.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node-binding/client.cc b/node-binding/client.cc index 2d2227f7..52dc0a5f 100644 --- a/node-binding/client.cc +++ b/node-binding/client.cc @@ -33,6 +33,7 @@ public: uint64_t offset = 0, len = 0, version = 0; bool with_parents = false; Nan::Persistent callback; + Nan::Persistent buffer_ref; }; static uint64_t get_ui64(const v8::Local & val) @@ -182,6 +183,7 @@ NodeVitastorRequest* NodeVitastor::get_write_request(const Nan::FunctionCallback req->offset = offset; req->version = version; + req->buffer_ref.Reset(bufarg); if (bufarg->IsArray()) {