Selfdestruction of an object

3 vues (au cours des 30 derniers jours)
rocketMan
rocketMan le 12 Mar 2022
Commenté : rocketMan le 13 Mar 2022
Hey,
is it possible to make an object destroy itself and how?

Réponse acceptée

Walter Roberson
Walter Roberson le 12 Mar 2022
If you have a handle object, then when it is constructed, or upon any relevant event, it can create a timer that does a delete() of the object. This will affect all places that have a copy of the handle.
If you have a value object, then NO, the most you could do would be to destroy a copy of the object, but all the other copies would be intact.
  1 commentaire
rocketMan
rocketMan le 13 Mar 2022
Thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Problem-Based Optimization Setup dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by