documentcloud/backbone — Issue #725: Circular references in views?
Author: laszlokorte
Created: 2011-11-06 16:18:02+00:00
State: open

I just started playing around with backbonejs planing to use it in a coming project.

Am I right that all the backbone views are resulting in circular references as:

the view object has a reference to the dom element object
the dom element has references to the callback functions to be call on dom events
most of these callbacks are properties of the view object with "this" bound to the view object.

That results in ...->viewObject->domElement->eventCallback->viewObject->...

In many cases this may not be a problem but in my case I have a very large table (20columns, 700-2000 rows) and I plan to implement the cells to be each a separate view object. That would result in 2*40.000 objects never being garbage collected.

Is there any easy way to resolve this problem? Or is it not a problem at all and I just have overseen anything?