fix: destroy term before stopping signals (#1310)

This commit is contained in:
三咲雅 · Misaki Masa 2024-07-19 22:41:15 +08:00 committed by GitHub
parent d6081fbe6f
commit 640efcee26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,7 +15,11 @@ impl App {
pub(crate) fn stop(&mut self, opt: impl Into<Opt>) {
self.cx.manager.active_mut().preview.reset_image();
self.signals.stop(opt.into().tx);
// We need to destroy the `term` first before stopping the `signals`
// to prevent any signal from triggering the term to render again
// while the app is being suspended.
self.term = None;
self.signals.stop(opt.into().tx);
}
}