Files
test2/source/blender/blenkernel
Jacques Lucke cc8979650b Screen: support garbage collection of layout panel states
Identifying layout-panels using strings and storing their open-state in their
parent panel is generally very convenient. However, right now there is no
mechanism to free the open-close state of panels that are not in use anymore.
It's generally not possible to know if a panel is not used anymore (e.g. it may
also belong to a temporarily disabled add-on). So every mechanism here will be
based on heuristics. A simple but typically very good heuristic is to just
remove the least-recently-used panel states when there are too many. So that's
what is implemented here.

This introduces a logical clock that increases whenever a panel state is used
and stores the last usage time on the panel state. This allows us to remove the
least-recently-used states later on. Specifically, that is done when the .blend
file is loaded the next time. It's not done at another time, because it quite
difficult to be sure that freeing panel states wouldn't cause dangling pointers
in such cases. I think doing it on-load should be good enough for all practical
use-cases.

Note, I don't know if the lack of such garbage collection has ever caused a
problem anywhere. However, it seems better to have some solution now than trying
to solve it after the problem has occurred and made someone's file unusable.

Pull Request: https://projects.blender.org/blender/blender/pulls/135569
2025-03-06 17:41:49 +01:00
..
2025-02-23 21:02:54 +11:00
2025-01-29 12:31:19 +11:00
2025-02-18 15:36:50 +01:00
2025-02-23 21:02:54 +11:00