Comments on: Point of Style: Differentiating Objects from Constructors in DHTML Widgets http://isaacschlueter.com/2007/04/point-of-style-differentiating-objects-from-constructors-in-dhtml-widgets/ Just slightly more than my twitter stream. Fri, 20 Nov 2015 19:12:29 +0000 http://wordpress.org/?v=2.5.1 By: Isaac http://isaacschlueter.com/2007/04/point-of-style-differentiating-objects-from-constructors-in-dhtml-widgets/#comment-3519 Isaac Sat, 14 Apr 2007 20:45:27 +0000 http://isaacschlueter.com/2007/04/point-of-style-differentiating-objects-from-constructors-in-dhtml-widgets/#comment-3519 Good question! Circular references as such are not the problem. In order to cause a memory leak, the reference chain must pass into Dom/ActiveX space and then back into Javascript space. For example: // reference from JS object -> Dom var o = { b : document.body }; // reference from Dom back to that JS object document.body.foo = o; <a href="http://isaacschlueter.com/2006/10/msie-memory-leaks/" rel="nofollow">http://isaacschlueter.com/2006/10/msie-memory-leaks/</a> In this case, since there are only links being created by JS objects to other JS objects, it's fine. And, in fact, the references aren't circular: the constructor object refers to the created objects, but not the other way around. Good question!

Circular references as such are not the problem. In order to cause a memory leak, the reference chain must pass into Dom/ActiveX space and then back into Javascript space. For example:

// reference from JS object -> Dom
var o = { b : document.body };

// reference from Dom back to that JS object
document.body.foo = o;

http://isaacschlueter.com/2006/10/msie-memory-leaks/

In this case, since there are only links being created by JS objects to other JS objects, it’s fine. And, in fact, the references aren’t circular: the constructor object refers to the created objects, but not the other way around.

]]>
By: Peter Goodman http://isaacschlueter.com/2007/04/point-of-style-differentiating-objects-from-constructors-in-dhtml-widgets/#comment-3509 Peter Goodman Sat, 14 Apr 2007 03:58:36 +0000 http://isaacschlueter.com/2007/04/point-of-style-differentiating-objects-from-constructors-in-dhtml-widgets/#comment-3509 I just seems like the circular references would cause a memory leak in IE... or is that not an issue/the case? I just seems like the circular references would cause a memory leak in IE… or is that not an issue/the case?

]]>

Warning: fopen(/var/www/isaacschlueter.com/public/wp-content/cache/meta/wp-cache-5237dd2c64a6c8b22b4b8af90fcb7d69.meta) [function.fopen]: failed to open stream: Permission denied in /var/www/isaacschlueter.com/public/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 378

Warning: fputs(): supplied argument is not a valid stream resource in /var/www/isaacschlueter.com/public/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 379

Warning: fclose(): supplied argument is not a valid stream resource in /var/www/isaacschlueter.com/public/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 380