Does using jQuery .data() on an element and then removing the element via direct DOM manipulation leak memory
<p>I've working on a site that was written using Prototype but we're phasing it to jQuery.  A lot of page updates are done via Prototype's Ajax.Updater. However, sometimes the elements that Prototype removes and replaces have had a jQuery widget run on them, so $.cache has references to the additional elements created by the widget.  Since jQuery isn't doing the DOM removal, it doesn't have a chance to clear the data from $.cache for those elements when they are removed, and I end up with a memory leak.  Is there a way to tell jQuery to check it's $.cache and discard any data for elements that are no longer in the DOM?</p>
