From: Michael Vasseur Date: Sun, 7 Feb 2016 09:20:38 +0000 (+0100) Subject: Using node::Buffer::Copy() instead of node::Buffer::New() to copy the handle bytes... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=702455674bbf721f2191bf294b54a2107eb2dfd2;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Using node::Buffer::Copy() instead of node::Buffer::New() to copy the handle bytes to buffer make the buffer really contains the data. --- diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index bcf6ccc..ea1d95b 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -109,7 +109,7 @@ void TranslateOldOptions(v8::Isolate* isolate, v8::Local options) { // Converts binary data to Buffer. v8::Local ToBuffer(v8::Isolate* isolate, void* val, int size) { - auto buffer = node::Buffer::New(isolate, static_cast(val), size); + auto buffer = node::Buffer::Copy(isolate, static_cast(val), size); if (buffer.IsEmpty()) return v8::Null(isolate); else