Skip to content

Commit

Permalink
feat: Remove unecessary drop calls
Browse files Browse the repository at this point in the history
* Segfault issue has been fixed in upstream PW.

Signed-off-by: Shinyzenith <[email protected]>
  • Loading branch information
Shinyzenith committed Oct 8, 2023
1 parent 43eb830 commit 0e73d47
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/pipewirethread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,13 @@ impl ScreencastThread {
let (thread_stop_tx, thread_stop_rx) = pipewire::channel::channel::<()>();
std::thread::spawn(move || {
match start_stream(overlay_cursor, width, height, capture_region, output) {
Ok((loop_, listener, context, node_id_rx)) => {
Ok((loop_, _listener, _context, node_id_rx)) => {
tx.send(Ok(node_id_rx)).unwrap();
let weak_loop = loop_.downgrade();
let _receiver = thread_stop_rx.attach(&loop_, move |()| {
weak_loop.upgrade().unwrap().quit();
});
loop_.run();
// XXX fix segfault with opposite drop order
drop(listener);
drop(context);
}
Err(err) => tx.send(Err(err)).unwrap(),
};
Expand All @@ -62,7 +59,7 @@ impl ScreencastThread {
type PipewireStreamResult = (
pipewire::MainLoop,
pipewire::stream::StreamListener<()>,
pipewire::Context<pipewire::MainLoop>,
pipewire::Context,
oneshot::Receiver<anyhow::Result<u32>>,
);

Expand Down

0 comments on commit 0e73d47

Please sign in to comment.