Using container.NewThemeOverride leaks memory until window closing #5000
Labels
blocker
Items that would block a forthcoming release
bug
Something isn't working
optimization
Tickets that could help Fyne apps run faster
Milestone
Checklist
Describe the bug
When adding a widget to a container.NewThemeOverride, the widget and its override theme are stored in the
overrides
map. This is never cleaned out except when a window is closing. This is because the deletion of the widget's entry in theoverrides
map happens incache.DestroyRenderer
, but that function is only called when a window is closing. Elsewhere (eg in the regular clean task), renderers are directly destroyed instead of by calling this function, which misses the deletion of the entry from the overrides map, if that widget had a theme override.How to reproduce
just check the code as described above. Or create an app that cycles through new widgets, applying an override to them, and then not using them. It will leak memory
Screenshots
No response
Example code
n/a
Fyne version
2.5.0
Go compiler version
n/a
Operating system and version
n/a
Additional Information
No response
The text was updated successfully, but these errors were encountered: