release .net objects
显示 更早的评论
If I create a .NET object instance, then that instance is never garbage collected, even if I call "clear all"
4 个评论
Guillaume
2020-1-8
Can you provide a bit more details, such as example code and how you ascertain the object is not destroyed?
Guillaume
2020-1-8

Constructor of base class (retains a reference to a "Layout" object):

Here the test code in Matlab:

At the end, by looking with a memory profiling tool I can see that Matlab application retains 4 instances of "Layout" and 4 instances of "RoadmapHelper"
Roberto Olmi
2020-1-8
Guillaume
2020-1-8
The delete calls should have released all the references that matlab holds to your objects. The garbage collection itself is handled by .Net itself. Could it be that your LayoutLoader keeps hold of references to the objects?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 .NET Methods in MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

