Merge pull request #1593 from alexcrichton/fix-test-leak
Fix a memory leak in the test suite
This commit is contained in:
@@ -20,13 +20,15 @@ fn test_import_calling_export() {
|
|||||||
let module = Module::new(&store, WAT).expect("failed to create module");
|
let module = Module::new(&store, WAT).expect("failed to create module");
|
||||||
|
|
||||||
let other = Rc::new(RefCell::new(None::<Func>));
|
let other = Rc::new(RefCell::new(None::<Func>));
|
||||||
let other2 = other.clone();
|
let other2 = Rc::downgrade(&other);
|
||||||
|
|
||||||
let callback_func = Func::new(
|
let callback_func = Func::new(
|
||||||
&store,
|
&store,
|
||||||
FuncType::new(Box::new([]), Box::new([])),
|
FuncType::new(Box::new([]), Box::new([])),
|
||||||
move |_, _, _| {
|
move |_, _, _| {
|
||||||
other2
|
other2
|
||||||
|
.upgrade()
|
||||||
|
.unwrap()
|
||||||
.borrow()
|
.borrow()
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.expect("expected a function ref")
|
.expect("expected a function ref")
|
||||||
|
|||||||
Reference in New Issue
Block a user