Ensure runners clean up attached resources on drop

This commit is contained in:
andrussal 2026-03-07 08:44:35 +01:00
parent d4c5b9fe99
commit d34ac87411

View File

@ -27,6 +27,12 @@ pub struct Runner<E: Application> {
cleanup_guard: Option<Box<dyn CleanupGuard>>,
}
impl<E: Application> Drop for Runner<E> {
fn drop(&mut self) {
self.cleanup();
}
}
impl<E: Application> Runner<E> {
/// Construct a runner from the run context and optional cleanup guard.
#[must_use]