diff --git a/lapce-proxy/src/plugin.rs b/lapce-proxy/src/plugin.rs index 67a7deb0..b6801813 100644 --- a/lapce-proxy/src/plugin.rs +++ b/lapce-proxy/src/plugin.rs @@ -248,7 +248,7 @@ fn start_plugin( let (tx, rx) = mpsc::channel(); thread::spawn(move || loop { - match rx.try_recv() { + match rx.recv() { Ok(PluginTransmissionMessage::Initialize) => { let initialize = local_plugin .instance @@ -283,7 +283,9 @@ fn start_plugin( } break; } - _ => {} + // There was an error when receiving, which means that the other end was closed. + // So we simply shutdown this thread by breaking out of the loop + Err(_) => break, } }); tx.send(PluginTransmissionMessage::Initialize)?;