diff options
| author | Andrej Mihajlov <and.mikhaylov@gmail.com> | 2024-03-09 08:56:08 +0100 |
|---|---|---|
| committer | David Lönnhager <dv.lnh.d@gmail.com> | 2024-03-11 13:04:51 +0100 |
| commit | 0188e40fb8dc94ba8cf967cdefa532c5fbd24382 (patch) | |
| tree | 6c5445e3f18e06680260b904b8e9b6d13887cd21 | |
| parent | f043b32b9b587ce3b3da97ab903247fd403c3b80 (diff) | |
| download | mullvadvpn-0188e40fb8dc94ba8cf967cdefa532c5fbd24382.tar.xz mullvadvpn-0188e40fb8dc94ba8cf967cdefa532c5fbd24382.zip | |
Use block_in_place() in drop impl
See: https://github.com/tokio-rs/tokio/issues/5843
| -rw-r--r-- | talpid-routing/src/unix/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/talpid-routing/src/unix/mod.rs b/talpid-routing/src/unix/mod.rs index 1cdf9fc26c..a979b362e0 100644 --- a/talpid-routing/src/unix/mod.rs +++ b/talpid-routing/src/unix/mod.rs @@ -251,7 +251,6 @@ pub enum CallbackMessage { /// the route will be adjusted dynamically when the default route changes. pub struct RouteManager { manage_tx: Option<Arc<UnboundedSender<RouteManagerCommand>>>, - runtime: tokio::runtime::Handle, } impl RouteManager { @@ -274,7 +273,6 @@ impl RouteManager { tokio::spawn(manager.run(manage_rx)); Ok(Self { - runtime: tokio::runtime::Handle::current(), manage_tx: Some(manage_tx), }) } @@ -333,6 +331,8 @@ impl RouteManager { impl Drop for RouteManager { fn drop(&mut self) { - self.runtime.clone().block_on(self.stop()); + tokio::task::block_in_place(move || { + tokio::runtime::Handle::current().block_on(self.stop()); + }); } } |
