mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-09-02 17:15:43 +00:00
instance: drop dns in Drop
This commit is contained in:
@@ -1401,6 +1401,7 @@ impl Instance {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: duplicated with clear_resources?
|
||||||
impl Drop for Instance {
|
impl Drop for Instance {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let my_peer_id = self.peer_manager.my_peer_id();
|
let my_peer_id = self.peer_manager.my_peer_id();
|
||||||
@@ -1412,9 +1413,12 @@ impl Drop for Instance {
|
|||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
// TODO: change this
|
// TODO: change this
|
||||||
#[cfg(feature = "magic-dns")]
|
#[cfg(feature = "magic-dns")]
|
||||||
dns.stop().await.unwrap_or_else(|e| {
|
{
|
||||||
tracing::error!("failed to stop dns, err: {:?}", e);
|
dns.stop().await.unwrap_or_else(|e| {
|
||||||
});
|
tracing::error!("failed to stop dns, err: {:?}", e);
|
||||||
|
});
|
||||||
|
drop(dns);
|
||||||
|
}
|
||||||
#[cfg(feature = "tun")]
|
#[cfg(feature = "tun")]
|
||||||
nic_ctx.lock().await.take();
|
nic_ctx.lock().await.take();
|
||||||
if let Some(pm) = pm.upgrade() {
|
if let Some(pm) = pm.upgrade() {
|
||||||
|
|||||||
Reference in New Issue
Block a user