Skip to content

Commit 0188e40

Browse files
pronebirddlon
authored andcommitted
Use block_in_place() in drop impl
See: tokio-rs/tokio#5843
1 parent f043b32 commit 0188e40

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

talpid-routing/src/unix/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ pub enum CallbackMessage {
251251
/// the route will be adjusted dynamically when the default route changes.
252252
pub struct RouteManager {
253253
manage_tx: Option<Arc<UnboundedSender<RouteManagerCommand>>>,
254-
runtime: tokio::runtime::Handle,
255254
}
256255

257256
impl RouteManager {
@@ -274,7 +273,6 @@ impl RouteManager {
274273
tokio::spawn(manager.run(manage_rx));
275274

276275
Ok(Self {
277-
runtime: tokio::runtime::Handle::current(),
278276
manage_tx: Some(manage_tx),
279277
})
280278
}
@@ -333,6 +331,8 @@ impl RouteManager {
333331

334332
impl Drop for RouteManager {
335333
fn drop(&mut self) {
336-
self.runtime.clone().block_on(self.stop());
334+
tokio::task::block_in_place(move || {
335+
tokio::runtime::Handle::current().block_on(self.stop());
336+
});
337337
}
338338
}

0 commit comments

Comments
 (0)