javascript - Backbone 嵌套的 View 在 父级 的 View 被清除时能否自动垃圾回收?
PHP中文网
PHP中文网 2017-04-10 12:45:16
0
0
470

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 里怎么体现呢?

PHP中文网
PHP中文网

认证0级讲师

全部回覆 (0)
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!