Skip to content

Commit c7945eb

Browse files
author
Lorenzo Feroleto
committed
fix(shared_memory): restore free_context_memory where needed
1 parent eb74892 commit c7945eb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/interpreter/src/interpreter.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,10 @@ impl<'a> Interpreter<'a> {
146146

147147
/// Returns a copy of the interpreter's return value, if any.
148148
#[inline]
149-
pub fn return_value(&self) -> Bytes {
150-
self.return_value_slice().to_vec().into()
149+
pub fn return_value(&mut self) -> Bytes {
150+
let return_data = self.return_value_slice().to_vec().into();
151+
self.shared_memory.free_context_memory();
152+
return_data
151153
}
152154

153155
/// Returns a reference to the interpreter's return value, if any.

0 commit comments

Comments
 (0)