Does Matlab support destructor function in class?
Show older comments
For a normal class (not a handle class), can we set a destructor function so that when deleting a class instance, it does some house keeping work itself?
For example, I have a class containing a timer. When I delete the class, the timer handle is deleted, but the timer is still there and may be running. I have to remember to delete the timer manually before deleting the class.
Is Matlab considering adding this in newer versions? Thanks!
Accepted Answer
More Answers (0)
Categories
Find more on Entering Commands in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!