首页 > Backbone 嵌套的 View 在 父级 的 View 被清除时能否自动垃圾回收?

Backbone 嵌套的 View 在 父级 的 View 被清除时能否自动垃圾回收?

Github 看到讨论这个, 作者的回复里提到这一句了:

https://github.com/documentcloud/backbone/issues/2490#issuecomment-16514082

In a more agnostic setup, if the HTML for your subviews is removed at the same time that the models stop being referenced, it all just gets garbage collected for you. The more unnecessary references you have in JS, the less garbage collection gets to do its job. We should try to have as few as possible mandated by core Backbone.

这个过程具体是怎么回事的?

关于 JS 垃圾回收, 网上的说法是的没有引用时 JS 会进行回收, 在 Backbone 里怎么体现呢?

【热门文章】
【热门文章】