It's always good practice to remove them yes. You can also look into weakly referenced listeners, but it's still better to remove them yourself
Kyle McKnight Senior UI Engineer - Accesso 602.515.1444 (M) On Fri, Nov 25, 2016 at 10:39 AM, Frank Dahmen <[email protected]> wrote: > great, thanks > > but when added in AS then I always have to remove them manually, right? > > e.g.: > > private function do():void{ > otherBtn.addEventListener(.....); > } > > when is this done best in a view? > here: > > <s:View viewDeactivate="functionToRemoveAllASListeners()"> > > ? > > > > > Am 25.11.2016 um 16:27 schrieb Alex Harui: > >> >> On 11/25/16, 6:25 AM, "Frank Dahmen" <[email protected]> wrote: >> >> Hi, >>> e.g. >>> >>> <s:View creationComplete="init()"> >>> <s:Button click="do() "/> >>> </s:View> >>> >>> when i call navigator.popView() >>> will the 2 eventhandlers be removed so the view can be gc'd ? >>> >> Assuming init() and do() are defined in the same MXML file and do not >> reference things outside the MXML file, there is no need to remove the >> handlers to enable GC. >> >> HTH, >> -Alex >> >> >
