mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-04 06:11:02 +00:00
The filament legend held its texture id in a function local static while the loader it calls generates a new texture every time, and BitmapCache deletes none, so a dual nozzle printer leaked one texture per filament per frame while the preview was open, along with an SVG read and a rasterize per frame. The same pattern sat in menu_item_with_icon. Textures are now cached on what actually varies and released with the rest of the ImGui resources. The canvas reuses frames by hashing the draw commands, which include the texture id, so a fresh id every frame also kept frame skipping from ever triggering. TriangleSelectorPatch did not release its VAO and buffers in the destructor, so every gizmo close leaked them. The base class already issues GL deletes on that same path, so this adds no new context requirement. bind_event_handlers() installed three lambdas that unbind_event_handlers() could not remove, because wx matches handlers by functor address. They are member functions now, so bind and unbind are symmetric, and the view switch stops stacking handlers. The five selection dependent menus were allocated with new on every popup and never owned. PopupMenu is synchronous and none of them is used as a submenu, so a single owner is enough. remove_notification_of_type stopped at the first match, so clear_all() left the later instances of multi-instance types alive with object ids from a project that is gone. The measure gizmo cleared its raycaster map but not the map holding one full mesh decomposition per volume.