We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4918ed8 commit 2e54c5dCopy full SHA for 2e54c5d
core/src/net/event_loop.rs
@@ -58,6 +58,21 @@ pub(crate) struct EventLoop<'e> {
58
phantom_data: PhantomData<&'e EventLoop<'e>>,
59
}
60
61
+impl Drop for EventLoop<'_> {
62
+ fn drop(&mut self) {
63
+ if std::thread::panicking() {
64
+ return;
65
+ }
66
+ self.stop_sync(Duration::from_secs(30))
67
+ .unwrap_or_else(|e| panic!("Failed to stop event-loop {} due to {e} !", self.name()));
68
+ assert_eq!(
69
+ PoolState::Stopped,
70
+ self.state(),
71
+ "The event-loop is not stopped !"
72
+ );
73
74
+}
75
+
76
impl<'e> Deref for EventLoop<'e> {
77
type Target = CoroutinePool<'e>;
78
0 commit comments