Flush effects when dropping a TestAppContext
This way, at the end of a test, dropped entities will be removed, and will drop the handles that they hold.
This commit is contained in:
parent
7d53e37672
commit
426e0e3d4f
1 changed files with 6 additions and 0 deletions
|
@ -565,6 +565,12 @@ impl TestAppContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Drop for TestAppContext {
|
||||||
|
fn drop(&mut self) {
|
||||||
|
self.cx.borrow_mut().flush_effects();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl AsyncAppContext {
|
impl AsyncAppContext {
|
||||||
pub fn spawn<F, Fut, T>(&self, f: F) -> Task<T>
|
pub fn spawn<F, Fut, T>(&self, f: F) -> Task<T>
|
||||||
where
|
where
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue