fix: set_rectangle leak
This commit is contained in:
parent
f032e7dbd5
commit
aac1e19f08
1 changed files with 4 additions and 5 deletions
|
|
@ -237,11 +237,10 @@ where
|
|||
window_from_handle::<<D as ToplevelInfoHandler>::Window>(toplevel).unwrap();
|
||||
if let Some(toplevel_state) = window.user_data().get::<ToplevelState>() {
|
||||
let mut toplevel_state = toplevel_state.lock().unwrap();
|
||||
if width == 0 && height == 0 {
|
||||
toplevel_state
|
||||
.rectangles
|
||||
.retain(|(s, _)| s.id() != surface.id());
|
||||
} else {
|
||||
toplevel_state
|
||||
.rectangles
|
||||
.retain(|(s, _)| s.id() != surface.id());
|
||||
if width != 0 || height != 0 {
|
||||
toplevel_state.rectangles.push((
|
||||
surface.downgrade(),
|
||||
Rectangle::new((x, y).into(), (width, height).into()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue