title: Am i creating a memory leak?
body: <p>I have a JavaScript closure which I keep recreating throughout the life time of my web application (single full-ajax page).</p>
  
  <p>I would like to know if it's creating a memory leak. </p>
  
  <p>Here is an example <a href="http://jsfiddle.net/bqqjU/" rel="noreferrer">JSFIDDLE</a></p>
  
  <p>The code in question:</p>
  
  <pre><code>function CreateLinks() {
  
      var ul = $("&lt;ul&gt;&lt;/ul&gt;").appendTo('div#links');
  
      for (var i in myLinks) {
  
          var li = $('&lt;li&gt;' + myLinks[i].name + '&lt;/li&gt;').appendTo(ul);
  
          //closure starts here
          (function (value) {
              li.click(function (e) {
                  $('div#info').append('&lt;label&gt;' + value + '&lt;/label&gt;&lt;br /&gt;');
                  RecreateLinks();
              });
          })(myLinks[i].value);
  
      }
  }
  </code></pre>