Skip to content

Commit

Permalink
fix(stdlib): Fixed a memory leak in Buffer.addStringSlice. (#1122)
Browse files Browse the repository at this point in the history
  • Loading branch information
cician committed Jan 31, 2022
1 parent 0ca66bd commit c4e1911
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stdlib/buffer.gr
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ export let rec addStringSlice = (start: Number, length, string, buffer) => {
start
}
}
Memory.incRef(WasmI32.fromGrain(length))
Memory.incRef(WasmI32.fromGrain((+)))
let end = start + length
Memory.incRef(WasmI32.fromGrain(String.slice))
// no incref for start since we know it's a simple num. Add back for good measure after #1071 is fixed!
Expand Down

0 comments on commit c4e1911

Please sign in to comment.