Implementing a weak reference in Matlab
显示 更早的评论
When someone makes a request for an object with certain parameters, I'd like to return an existing object (of handle type) if the parameters match accordingly. Unfortunately, if the object server holds onto the object so that it can be returned instead of a new object, the object will never be cleared. If the object server is the only thing holding onto the object, then I want it to be cleared.
Is this possible?
2 个评论
Jim Hokanson
2020-3-25
Walter Roberson
2024-7-19
(The solution mentioned by @Nikolaus Koopmann is for the upcoming R2024b, and is not yet an official part of MATLAB.)
回答(1 个)
Nikolaus Koopmann
2024-7-19
移动:Adam Danz
2025-4-4
0 个投票
类别
在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!