ghassmo 4 роки тому
батько
коміт
cb8e873d95
1 змінених файлів з 2 додано та 1 видалено
  1. 2 1
      src/net/channel.rs

+ 2 - 1
src/net/channel.rs

@@ -117,12 +117,13 @@ impl Channel {
         let mut stopped = self.stopped.lock().await;
         if !*stopped {
             *stopped = true;
+            drop(stopped);
+
             self.stop_subscriber.notify(Error::ChannelStopped).await;
             self.receive_task.stop().await;
             self.message_subsystem.trigger_error(Error::ChannelStopped).await;
             debug!(target: "net", "Channel::stop() [END, address={}]", self.address());
         }
-        drop(stopped);
     }
 
     /// Creates a subscription to a stopped signal.