replacement for event.hasListener in linux environment
1 view (last 30 days)
Show older comments
Hi, I work in a lab environment and have been exploring classes to perform data handling and analysis. I've found that my objects are sticking around in memory after I clear them, which is problematic since they contain gigabytes of data. This seems to be because of listeners that haven't been properly deleted prior to clearing the class. I'd like to have a delete method that checks all the events of a class and throws a warning if one still has a listener, so that the user can delete the associated listener and free up the memory. In windows, I can simply use the event.hasListener method to check whether an event is being listened to:
if event.hasListener(obj,eventName)
warning('delete:ListenersNotCleared',['some listeners to ',eventName,' still exist])
end
My problem is that this code will need to run on a mix of systems (Windows, Linux, Mac), and event.hasListener doesn't seem to be available in the Linux environment. 'help event' does not list addListener as a method of the event class, and I haven't been able to come up with a suitable replacement. Is there something I'm missing, or am I simply out of luck? All my computers are running R2015A or later.
Thanks for your time.
Tucker
0 Comments
Answers (0)
See Also
Categories
Find more on Introduction to Installation and Licensing 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!