1
Fork 0

Don't leak the function that is called on drop

This commit is contained in:
Maybe Waffle 2023-05-23 14:53:36 +00:00
parent f3d597b31c
commit e2b953063d
5 changed files with 21 additions and 15 deletions

View file

@ -78,7 +78,7 @@ where
{
TLV.with(|tlv| {
let old = tlv.replace(erase(context));
let _reset = rustc_data_structures::OnDrop(move || tlv.set(old));
let _reset = rustc_data_structures::defer(move || tlv.set(old));
f()
})
}