Skip to content

Commit

Permalink
improv(wallpapers): reclaim memory when leaving page
Browse files Browse the repository at this point in the history
  • Loading branch information
mmstick committed Jan 23, 2025
1 parent f4005a3 commit 95a03e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cosmic-settings/src/pages/desktop/wallpaper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ impl page::Page<crate::pages::Message> for Page {
}

fn on_leave(&mut self) -> Task<crate::pages::Message> {
// Reclaim memory
self.cached_display_handle = None;
self.selection = Context::default();
self.outputs = SingleSelectModel::default();

// Cancel the on_enter task if it was running.
if let Some(handle) = self.on_enter_handle.take() {
handle.abort();
Expand Down

0 comments on commit 95a03e1

Please sign in to comment.