ExtJs组件清理

ExtJs组件清理,extjs,extjs3,Extjs,Extjs3,我在ExtJs中阅读了以下评论- 'Do not dismiss the destruction portion of a Component’s lifecycle if you plan on developing your own custom Components. Many developers have gotten into trouble when they’ve ignored this crucial step and have code that has left arti

我在ExtJs中阅读了以下评论-

'Do not dismiss the destruction portion of a Component’s lifecycle if you plan on developing your own custom
Components. Many developers have gotten into trouble when they’ve ignored this crucial step and have code that
has left artifacts such as data Stores that continuously poll web servers...'
我从未在3.4.x中的容器/组件上调用过显式析构函数/destroy 虽然事情似乎进展顺利,但我对它很好奇 1.在哪些情况下,实现析构函数变得至关重要
2.关闭浏览器实例时处理组件销毁的正确约定是什么。

这可能是一个好的阅读方法

你应该总是考虑在需要释放内存之后清理你的对象,尤其是解除绑定事件侦听器和你用“代码> SETIFATION/CODE >创建的任何定时器。一旦对象引用被销毁,您就无法访问它,但它仍可能侦听或触发事件,并耗尽资源

通常在ExtJs中,您可以在destroy方法中释放资源,但也要记住调用
callParent()
函数,以便ExtJs自己进行清理

下面是IBM在2012年发布的另一篇文章,它似乎更深入地探讨了这个问题