Skip to content

Commit

Permalink
Fixed the remaining memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitSeb committed Jan 25, 2023
1 parent ec368e7 commit df6bc6b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/vm/src/instance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,9 @@ impl Drop for VMInstance {
let instance_ptr = self.instance.as_ptr();

unsafe {
// Need to drop all the actual Instance members
instance_ptr.drop_in_place();
// And then free the memory allocated for the Instance itself
std::alloc::dealloc(instance_ptr as *mut u8, self.instance_layout);
}
}
Expand Down

0 comments on commit df6bc6b

Please sign in to comment.