Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up background processes when changing tutorial in fyne_demo #5450

Merged

Conversation

Jacalz
Copy link
Member

@Jacalz Jacalz commented Jan 23, 2025

Description:

All animations and tickers were recreated on loading a new page. Animations resulted in just background CPU usage but the tickers can not (until go.mod defaults to Go 1.23) be GC'd before stop so they would tick in the background forever while basically leaking CPU and memory.

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

All animations and tickers were recreated on loading a new page. Animations resulted in just background CPU usage but the tickers can not (until go.mod defaults to Go 1.23) be GC'd before stop so they would tick in the background forever.
@coveralls
Copy link

coveralls commented Jan 23, 2025

Coverage Status

coverage: 59.099% (-0.04%) from 59.134%
when pulling dd4dbbf on Jacalz:stop-animations-when-switching-tutorial
into 22234be on fyne-io:develop.

@Jacalz
Copy link
Member Author

Jacalz commented Jan 24, 2025

I should note that this makes life a lot easier when testing #5422. That's the motivation behind this so there is 0% cpu more often :)

Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not amazing having those string IDs re-declared but it seems ok for this fix. I'm still opting to get the revised demo system in for 2.6 which will be able to refactor this further.

@Jacalz Jacalz merged commit cfe403e into fyne-io:develop Jan 24, 2025
11 checks passed
@Jacalz Jacalz deleted the stop-animations-when-switching-tutorial branch January 24, 2025 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants