Skip to content

Commit bca8889

Browse files
committed
properly terminate input capture
1 parent dfe73a6 commit bca8889

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/capture.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,19 +184,18 @@ async fn do_capture(
184184
});
185185

186186
/* create barriers for active clients */
187-
if let Err(e) = create_clients(&mut capture, clients, request_rx).await {
187+
let r = create_clients(&mut capture, clients, request_rx).await;
188+
if let Err(e) = r {
188189
capture.terminate().await?;
189190
return Err(e.into());
190191
}
191192

192-
if let Err(e) =
193-
do_capture_session(active, &mut capture, conn, event_tx, request_rx, service).await
194-
{
195-
// FIXME replace with async drop when stabilized
196-
capture.terminate().await?;
197-
return Err(e);
198-
}
199-
Ok(())
193+
let r = do_capture_session(active, &mut capture, conn, event_tx, request_rx, service).await;
194+
195+
// FIXME replace with async drop when stabilized
196+
capture.terminate().await?;
197+
198+
r
200199
}
201200

202201
async fn create_clients(

0 commit comments

Comments
 (0)