mirror of
https://github.com/rust-lang/futures-rs.git
synced 2026-01-25 03:26:14 +00:00
Fix make_permanent logic
Don't invoke callbacks when `make_permanent` is called
This commit is contained in:
@@ -79,14 +79,15 @@ mod std_support {
|
||||
fn drop(&mut self) {
|
||||
ENTERED.with(|c| {
|
||||
assert!(c.get());
|
||||
if self.permanent {
|
||||
return
|
||||
}
|
||||
|
||||
let mut on_exit = self.on_exit.borrow_mut();
|
||||
for callback in on_exit.drain(..) {
|
||||
callback.call();
|
||||
}
|
||||
if !self.permanent {
|
||||
c.set(false);
|
||||
}
|
||||
c.set(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user