Delete all event listeners in Flex

How can I remove all event listeners on all components at once, especially when it is not known which listeners are connected to each component?

+3
source share
4 answers

You can override mx.core.FlexSprite from which the UIComponent does not exist and create an array of created listeners. Doug Mc Cune posted the source code here .

His blog says: removeAllEventListeners () - removes all event listeners of all types. This completely destroys all event listeners for the component all at once.

Let us know if this works!

+3
source

No!

, - hasEventListener willTrigger. , , , .

?

+1

Adobe JIRA has a problem in this task, please vote if you think this is important to you.

https://bugs.adobe.com/jira/browse/SDK-14127

0
source

Elad Elrom has a message about its implementation for storing links to event listeners and their simultaneous removal:

http://elromdesign.com/blog/2010/07/16/easy-way-to-store-event-listeners-reference-prevent-memory-leaks/

0
source

Source: https://habr.com/ru/post/1758004/


All Articles