title: Memory leak using jquery-ui/datepicker
body: <p>I'm using these scripts (where jquery-ui[].custom.js is the datepicker plugin):</p>
  
  <pre><code>&lt;script src="../../Scripts/jquery-1.5.1.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="../../Scripts/jquery-ui-1.8.13.custom.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script id="formvalidation" type="text/javascript"&gt;
  $(document).ready(function () {
      $(".datepicker").datepicker({ dateFormat: 'dd/mm/yy' });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>On this input element (inside a form):</p>
  
  <pre><code>&lt;input type="text" name="Date" class="datepicker" /&gt;
  </code></pre>
  
  <p>The page loads fine and when I click in the input field the datepicker pops up correctly, but I get a memory leak (in every browser) once a date is selected and the datepicker disappears. This causes that bit of JS to crash or slow down the browser because of a memory leak in jquery-1.5.1.js:</p>
  
  <blockquote>
    <p>Line: 1520 Error: Out of memory</p>
  </blockquote>
  
  <p>When debugging I see the error line is at 2310</p>
  
  <pre><code>jQuery.event.remove( elem, type + types );
  </code></pre>
  
  <p>A little context:</p>
  
  <pre><code>// Unbind all events for the element
  if ( !types || typeof types === "string" &amp;&amp; types.charAt(0) === "." ) {
      types = types || "";
      for ( type in events ) {
          jQuery.event.remove( elem, type + types );
      }
      return;
  }
  </code></pre>
  
  <p>Am I doing something wrong or maybe its a bug in jquery? I'm also using the validation plugin but the same error occurs when I disable it.</p>
  
  <p>[Solved?]
  Since I can't post my answer for 8 hours:</p>
  
  <p>Solved the leak by switching to the minimal version of jquery (jquery-1.5.1.min.js &amp; jquery-ui-1.8.13.custom.min.js). It appears there is some discrepancy between the min version and the dev version. </p>
  
  <p>Side question: Where would be a good place to bring this up if its not already an issue?</p>