Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought

Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Author Topic: Is it mandatory to use removeMediator when not using mediator anymore  (Read 6859 times)
Jr. Member
Posts: 12

View Profile Email
« on: November 21, 2011, 09:16:30 »

Is removeMediator like removeListener, which should be used after mediator is not meant to be used anymore. Is it mandatory...like if i don't use it, would it add to garbage ?
Global Moderator
Hero Member
Posts: 2871

View Profile WWW Email
« Reply #1 on: November 21, 2011, 09:27:15 »

If your view component is removed from the view hierarchy (display list in Flash) and is no longer needed, then if that component has an associated mediator you should remove it, yes. If you are using Flash/Flex/AIR, you can listen to the component for Event.REMOVED and respond by having the mediator remove itself with:
Pages: [1]