Skip to content

Commit

Permalink
Merge pull request #645 from Smithay/fix/dmabuf_clone
Browse files Browse the repository at this point in the history
  • Loading branch information
Drakulix authored Jun 22, 2022
2 parents c30fc14 + a249f86 commit 27de600
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/wayland/dmabuf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@ impl DmabufState {
/// It is highly recommended you disable the global before destroying it and ensure all child objects have
/// been destroyed.
pub fn destroy_global<D: 'static>(&mut self, display: &DisplayHandle, global: DmabufGlobal) {
display.remove_global(self.globals.remove(&global.id).unwrap());
DMABUF_GLOBAL_IDS.lock().unwrap().remove(&global.id);
if DMABUF_GLOBAL_IDS.lock().unwrap().remove(&global.id) {
display.remove_global(self.globals.remove(&global.id).unwrap());
}
}
}

Expand Down Expand Up @@ -244,10 +245,9 @@ pub struct DmabufParamsData {
/// A handle to a registered dmabuf global.
///
/// This type may be used in equitability checks to determine which global a dmabuf is being imported to.
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
pub struct DmabufGlobal {
id: usize,
// note this type should never be `Clone` or `Copy`
}

/// Handler trait for [`Dmabuf`] import from the compositor.
Expand Down

0 comments on commit 27de600

Please sign in to comment.