1
0
Fork 0
forked from wry/wry

all: fix memory leaks

This commit is contained in:
Julian Orth 2022-05-18 22:42:36 +02:00
parent 56e3eee629
commit e5c0916a25
15 changed files with 147 additions and 54 deletions

View file

@ -154,6 +154,13 @@ impl NodeSeatState {
self.dnd_targets.remove(&seat.id);
self.pointer_grabs.remove(&seat.id);
}
pub fn clear(&self) {
self.kb_foci.clear();
self.pointer_foci.clear();
self.dnd_targets.clear();
self.pointer_grabs.clear();
}
}
impl WlSeatGlobal {

View file

@ -697,6 +697,8 @@ impl Object for WlSurface {
self.buffer.set(None);
self.toplevel.set(None);
self.idle_inhibitors.clear();
self.pending.presentation_feedback.borrow_mut().clear();
self.presentation_feedback.borrow_mut().clear();
}
}

View file

@ -140,6 +140,7 @@ impl WlSubsurface {
fn destroy(&self, parser: MsgParser<'_, '_>) -> Result<(), WlSubsurfaceError> {
let _req: Destroy = self.surface.client.parse(self, parser)?;
self.surface.unset_ext();
*self.pending.node.borrow_mut() = None;
*self.node.borrow_mut() = None;
{
let mut children = self.parent.children.borrow_mut();
@ -257,6 +258,11 @@ impl Object for WlSubsurface {
fn num_requests(&self) -> u32 {
SET_DESYNC + 1
}
fn break_loops(&self) {
*self.pending.node.borrow_mut() = None;
*self.node.borrow_mut() = None;
}
}
simple_add_obj!(WlSubsurface);