In the general case, it should be enough to remove from stage and let the garbage collector handle things. However, if a custom item renderer absolutely needs specific things cleaned up to avoid memory leaks (which should be rare), then this m ethod should be available as an opt-in feature for those who need to ensure that the DisplayObjectRecycler.destroy method is called when a ListView is no longer needed. This method will not be called automatically under any circumstances.
Until this method is available, setting dataProvider to null and calling validateNow() is probably enough to ensure that DisplayObjectRecycler.destroy is called for all item renderers.
In the general case, it should be enough to remove from stage and let the garbage collector handle things. However, if a custom item renderer absolutely needs specific things cleaned up to avoid memory leaks (which should be rare), then this m ethod should be available as an opt-in feature for those who need to ensure that the
DisplayObjectRecycler.destroy
method is called when aListView
is no longer needed. This method will not be called automatically under any circumstances.Until this method is available, setting
dataProvider
tonull
and callingvalidateNow()
is probably enough to ensure thatDisplayObjectRecycler.destroy
is called for all item renderers.