From edd1da7a4760818f46b4c2f5cd602ffeef066589 Mon Sep 17 00:00:00 2001 From: Brendan Hansknecht Date: Sat, 14 Dec 2024 13:57:12 -0800 Subject: [PATCH] make valgrind happy --- .../test-projects/false-interpreter/platform/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/cli/tests/test-projects/false-interpreter/platform/src/lib.rs b/crates/cli/tests/test-projects/false-interpreter/platform/src/lib.rs index 2bbe5cc47e..5da8ee0e84 100644 --- a/crates/cli/tests/test-projects/false-interpreter/platform/src/lib.rs +++ b/crates/cli/tests/test-projects/false-interpreter/platform/src/lib.rs @@ -102,9 +102,12 @@ pub extern "C" fn rust_main() -> i32 { let arg = env::args() .nth(1) .expect("Please pass a .false file as a command-line argument to the false interpreter!"); - let arg = RocStr::from(arg.as_str()); + let arg = ManuallyDrop::new(RocStr::from(arg.as_str())); - unsafe { roc_main(ManuallyDrop::new(arg)) }; + unsafe { roc_main(arg) }; + + // This really shouldn't need to be freed, but valgrid is picky about possibly lost. + *file_handles().lock().unwrap() = HashMap::default(); // Exit code 0