Don't leak the function that is called on drop
This commit is contained in:
parent
f3d597b31c
commit
e2b953063d
5 changed files with 21 additions and 15 deletions
|
@ -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()
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue