Move ownership of MacOSDisplay
to the rust side
This commit is contained in:
parent
4222f86537
commit
c25acc155d
3 changed files with 5 additions and 15 deletions
|
@ -187,11 +187,8 @@ impl Drop for RoomDelegate {
|
|||
pub struct LocalVideoTrack(*const c_void);
|
||||
|
||||
impl LocalVideoTrack {
|
||||
pub fn screen_share_for_display(display: MacOSDisplay) -> Self {
|
||||
let ptr = display.0;
|
||||
let this = Self(unsafe { LKCreateScreenShareTrackForDisplay(ptr) });
|
||||
std::mem::forget(display);
|
||||
this
|
||||
pub fn screen_share_for_display(display: &MacOSDisplay) -> Self {
|
||||
Self(unsafe { LKCreateScreenShareTrackForDisplay(display.0) })
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -259,7 +256,6 @@ pub fn display_sources() -> impl Future<Output = Result<Vec<MacOSDisplay>>> {
|
|||
let sources = CFArray::wrap_under_get_rule(sources);
|
||||
let sources_vec = sources.iter().map(|source| MacOSDisplay(*source)).collect();
|
||||
let _ = tx.send(Ok(sources_vec));
|
||||
std::mem::forget(sources); // HACK: If I drop the CFArray, all the objects inside it get dropped and we get issues accessing the display later.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue