Skip to content

Commit 019d443

Browse files
committed
Free memory allocated for typed arrays
This patch fixed the memory leak when using typed arrays on nodejs > 10 Fix: #842
1 parent 947aa26 commit 019d443

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/rcl_bindings.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,7 @@ NAN_METHOD(CreateArrayBufferFromAddress) {
13301330
memcpy(backing->Data(), addr, length);
13311331
auto array_buffer =
13321332
v8::ArrayBuffer::New(v8::Isolate::GetCurrent(), std::move(backing));
1333+
free(addr);
13331334
#endif
13341335

13351336
info.GetReturnValue().Set(array_buffer);

0 commit comments

Comments
 (0)