Tabs: Removing leftover 'uiTabs' data after removing a tab

Tabs: Removing leftover 'uiTabs' data after removing a tab

Hi,

Overview: I am experiencing performance issues using jQuery UI Tabs that seem to be related to uiTabs data that is not deleted once a tab is removed. I believe this data is keeping other objects from being garbage collected, as once this data is removed the performance issues stop. 

This leftover data is can be seen in the example provided on jQuery UI's site.


Details: In the uiTabs data, the 'bindings', 'focusable', and 'hoverable' objects continuously increase in size after adding and removing tabs. If you were to add 1000 tabs, and then remove those 1000 tabs, then 'bindings'/'focusable'/'hoverable' will contain a large number of references to objects that should no longer exist.  The one way I know of to remove this data using the Tabs API is to destroy the Tabs instance (using 'destroy') and recreating it. For the project I am working on, we create and remove a large number of tabs.

To see this in action: 

      1.  Go to the jQuery UI manipulation example     
       2.  Add a number of tabs, then inspect the data saved using   $("#tabs").data("uiTabs")  in the console (selecting the frame for manipulation.html )
      3.  Remove a number of tabs, and inspect the data using the same method above, noting what's left over.

If I'm not mistaken, this leftover data is causing the performance issues I mentioned by keeping references to objects that need to be garbage collected. Currently, the more we add/remove tabs, the slower the performance gets.


The Actual Question:  Is there any way to remove this leftover data specifically through jQueryUI's implementation, without having to call the "destroy" method that would destroy all the tabs?  What would you do?



Sorry if I misunderstood the cause. Any help would be greatly appreciated!

-Matt