From 7ed80bae920bf1851ef07ea5742fb16225353d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Mon, 1 Feb 2021 21:24:09 +0200 Subject: Reap proc macro server instances --- crates/proc_macro_api/src/process.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'crates/proc_macro_api/src') diff --git a/crates/proc_macro_api/src/process.rs b/crates/proc_macro_api/src/process.rs index 6d6ab8888..3ce851fe8 100644 --- a/crates/proc_macro_api/src/process.rs +++ b/crates/proc_macro_api/src/process.rs @@ -10,6 +10,7 @@ use std::{ }; use crossbeam_channel::{bounded, Receiver, Sender}; +use stdx::JodChild; use crate::{ msg::{ErrorCode, Message, Request, Response, ResponseError}, @@ -116,13 +117,7 @@ struct Task { } struct Process { - child: Child, -} - -impl Drop for Process { - fn drop(&mut self) { - let _ = self.child.kill(); - } + child: JodChild, } impl Process { @@ -131,7 +126,7 @@ impl Process { args: impl IntoIterator>, ) -> io::Result { let args: Vec = args.into_iter().map(|s| s.as_ref().into()).collect(); - let child = mk_child(&path, &args)?; + let child = JodChild(mk_child(&path, &args)?); Ok(Process { child }) } -- cgit v1.2.3