In this example, you can see how the first tab "Datatable Control" define the rules to destroy the YUI Datatable before change the content of the tab (which means that every time you click on the first tab, the dispatcher will destroy the DataTable control, releasing the memory and then will display the new content). Also, by default, the dispatcher will release all the listeners defined for a dynamic area before display the new content (YAHOO.util.Event.purgeElement).
// setting the destruction's rules
YAHOO.util.Dispatcher.destroyer.subscribe (function(el, config){
myDataTable.destroy ();
});