Skip to content

Commit c4e1911

Browse files
authored
fix(stdlib): Fixed a memory leak in Buffer.addStringSlice. (#1122)
1 parent 0ca66bd commit c4e1911

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/buffer.gr

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,8 @@ export let rec addStringSlice = (start: Number, length, string, buffer) => {
435435
start
436436
}
437437
}
438+
Memory.incRef(WasmI32.fromGrain(length))
439+
Memory.incRef(WasmI32.fromGrain((+)))
438440
let end = start + length
439441
Memory.incRef(WasmI32.fromGrain(String.slice))
440442
// no incref for start since we know it's a simple num. Add back for good measure after #1071 is fixed!

0 commit comments

Comments
 (0)