cc8979650bc10cd2762099d158498a119dad031a
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
…
Blender
Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.
Project Pages
Development
License
Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.
See blender.org/about/license for details.
Description
Languages
C++
78%
Python
14.9%
C
2.9%
GLSL
1.9%
CMake
1.2%
Other
0.9%
