JavaScript SPI.write output correction #2
Closes #330. Signed-off-by: Eugene Bolshakov <pub@relvarsoft.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -44,14 +44,17 @@ class Spi;
|
|||||||
{
|
{
|
||||||
%#if SWIG_V8_VERSION > 0x040000
|
%#if SWIG_V8_VERSION > 0x040000
|
||||||
v8::MaybeLocal<v8::Object> objret = node::Buffer::New(v8::Isolate::GetCurrent(), (char*) result, arg3);
|
v8::MaybeLocal<v8::Object> objret = node::Buffer::New(v8::Isolate::GetCurrent(), (char*) result, arg3);
|
||||||
|
free(result);
|
||||||
if(!objret.ToLocal(&$result)) {
|
if(!objret.ToLocal(&$result)) {
|
||||||
SWIG_exception_fail(SWIG_ERROR, "Spi buffer failed");
|
SWIG_exception_fail(SWIG_ERROR, "Spi buffer failed");
|
||||||
SWIGV8_RETURN(SWIGV8_UNDEFINED());
|
SWIGV8_RETURN(SWIGV8_UNDEFINED());
|
||||||
}
|
}
|
||||||
%#elif SWIG_V8_VERSION > 0x032870
|
%#elif SWIG_V8_VERSION > 0x032870
|
||||||
$result = node::Buffer::New((char*) result, arg3);
|
$result = node::Buffer::New((char*) result, arg3);
|
||||||
|
free(result);
|
||||||
%#else
|
%#else
|
||||||
$result = node::Buffer::New((char*) result, arg3)->handle_;
|
$result = node::Buffer::New((char*) result, arg3)->handle_;
|
||||||
|
free(result);
|
||||||
%#endif
|
%#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user