Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions crates/recording/src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use cap_project::{CursorClickEvent, CursorMoveEvent, XY};
use cap_timestamp::Timestamps;
use std::{collections::HashMap, path::PathBuf};
use tokio::sync::oneshot;
use tokio_util::sync::CancellationToken;
use tokio_util::sync::{CancellationToken, DropGuard};

pub struct Cursor {
pub file_name: String,
Expand All @@ -24,13 +24,13 @@ pub struct CursorActorResponse {
}

pub struct CursorActor {
stop: CancellationToken,
stop: DropGuard,
rx: oneshot::Receiver<CursorActorResponse>,
}

impl CursorActor {
pub async fn stop(self) -> CursorActorResponse {
self.stop.cancel();
drop(self.stop);
self.rx.await.unwrap()
}
}
Expand Down Expand Up @@ -180,7 +180,7 @@ pub fn spawn_cursor_recorder(
});

CursorActor {
stop: stop_token,
stop: stop_token.drop_guard(),
rx,
}
}
Expand Down
Loading