Implementing a weak reference in Matlab

4 vues (au cours des 30 derniers jours)
Jim Hokanson
Jim Hokanson le 7 Nov 2014
Déplacé(e) : Adam Danz le 4 Avr 2025
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 commentaires
Walter Roberson
Walter Roberson le 19 Juil 2024
(The solution mentioned by @Nikolaus Koopmann is for the upcoming R2024b, and is not yet an official part of MATLAB.)

Connectez-vous pour commenter.

Réponses (1)

Nikolaus Koopmann
Nikolaus Koopmann le 19 Juil 2024
Déplacé(e) : Adam Danz le 4 Avr 2025

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by