coffeescript - jQuery circular reference -


i made jquery plugin/widget oop object , in object saving html/jquery element ($elem) property. storing object's reference (created using new) in data attribute of html element. cause circular reference/memory leakage?

the code in coffeescript be:

class wid   constructor     @$elem = $('<div>hello</div>')     @$elem.appendto('body')     @$elem.data('obj',@)  // adding instance element's data attribute   updatetext: (p)->      @$ele.text(p)  widget = new wid() 

on real browser, no. internet explorer, microsoft's browser-shaped object, has separate garbage collectors dom , javascript, it's easy create circular references. since ie tightly integrated operating system, merely shutting down browser not free memory: os has rebooted.

however, thing: ie becomes slower , slower, weighed down unfreed object references, user learns vital lesson microsoft quality.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -