projects
/
ldk-java
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
52329a4
)
[C#] Free array buffers passed to C# after we've decoded them
author
Matt Corallo
<git@bluematt.me>
Wed, 24 Jan 2024 03:17:10 +0000
(
03:17
+0000)
committer
Matt Corallo
<git@bluematt.me>
Mon, 29 Jan 2024 16:37:42 +0000
(16:37 +0000)
c_sharp/src/org/ldk/util/InternalUtils.cs
patch
|
blob
|
history
diff --git
a/c_sharp/src/org/ldk/util/InternalUtils.cs
b/c_sharp/src/org/ldk/util/InternalUtils.cs
index 927409e2a4e2ce7782447ff809f38bebe7edae2c..9296adf0fdc59d7a49173191a780e16f4204a0ee 100644
(file)
--- a/
c_sharp/src/org/ldk/util/InternalUtils.cs
+++ b/
c_sharp/src/org/ldk/util/InternalUtils.cs
@@
-124,6
+124,7
@@
internal class InternalUtils {
byte[] res = new byte[len];
for (int i = 0; i < len; i++)
res[i] = getU8ArrayElem(arrptr, i);
byte[] res = new byte[len];
for (int i = 0; i < len; i++)
res[i] = getU8ArrayElem(arrptr, i);
+ bindings.free_buffer(arrptr);
return res;
}
public static short[] decodeUint16Array(long arrptr) {
return res;
}
public static short[] decodeUint16Array(long arrptr) {
@@
-131,6
+132,7
@@
internal class InternalUtils {
short[] res = new short[len];
for (int i = 0; i < len; i++)
res[i] = getU16ArrayElem(arrptr, i);
short[] res = new short[len];
for (int i = 0; i < len; i++)
res[i] = getU16ArrayElem(arrptr, i);
+ bindings.free_buffer(arrptr);
return res;
}
public static long[] decodeUint64Array(long arrptr) {
return res;
}
public static long[] decodeUint64Array(long arrptr) {
@@
-138,6
+140,7
@@
internal class InternalUtils {
long[] res = new long[len];
for (int i = 0; i < len; i++)
res[i] = getU64ArrayElem(arrptr, i);
long[] res = new long[len];
for (int i = 0; i < len; i++)
res[i] = getU64ArrayElem(arrptr, i);
+ bindings.free_buffer(arrptr);
return res;
}
}
return res;
}
}