X-Sharp / XSharpPublic

Public repository for the source code for the XSharp Compiler, Runtime, Project System and Tools.
Apache License 2.0
89 stars 36 forks source link

Menu resources are not always released in VO Gui. #1484

Open RobertvanderHulst opened 3 weeks ago

RobertvanderHulst commented 3 weeks ago

VO menu objects are registered in the WCMenuList array. Because this reference remains, these objects are never released. We have to adjust the Window:Destroy(), Control:Destroy() methods, as well as the assign properties (in case a new menu is assigned) to make sure that existing menus get destroyed properly. In VO the menu object itself is not in the WCMenuList but a special reference , a bit like a weak reference. Maybe we can also use a weak reference in the GUI classes to emulate this? In that case we do not have adjust all the places where menus have to be destroyed.

See https://www.xsharp.eu/forum/topic?p=30090#p30090