Implementing a weak reference in Matlab

12 ビュー (過去 30 日間)
Jim Hokanson
Jim Hokanson 2014 年 11 月 7 日
移動済み: Adam Danz 2025 年 4 月 4 日 20:14
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
Jim Hokanson 2020 年 3 月 25 日
Walter Roberson
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
Nikolaus Koopmann 2024 年 7 月 19 日
移動済み: Adam Danz 2025 年 4 月 4 日 20:14

カテゴリ

Help Center および File ExchangeWhos についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by