mirror of
https://github.com/LinuxBeginnings/swww.git
synced 2026-01-12 07:21:01 -03:00
Fix memory leak and stopped animation
This commit is contained in:
@@ -375,7 +375,6 @@ impl wayland::interfaces::wl_output::EvHandler for Daemon {
|
||||
wallpaper
|
||||
.borrow_mut()
|
||||
.commit_surface_changes(self.use_cache);
|
||||
self.stop_animations(&[wallpaper.clone()]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -480,8 +479,14 @@ impl wayland::interfaces::zwlr_layer_surface_v1::EvHandler for Daemon {
|
||||
}
|
||||
|
||||
fn closed(&mut self, sender_id: ObjectId) {
|
||||
self.wallpapers
|
||||
.retain(|w| !w.borrow().has_layer_surface(sender_id));
|
||||
if let Some(i) = self
|
||||
.wallpapers
|
||||
.iter()
|
||||
.position(|w| w.borrow().has_layer_surface(sender_id))
|
||||
{
|
||||
let w = self.wallpapers.remove(i);
|
||||
self.stop_animations(&[w]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user