replacement for event.hasListener in linux environment

1 回表示 (過去 30 日間)
Tucker
Tucker 2016 年 7 月 13 日
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 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by