简体   繁体   中英

How free memory after using `Ext.window.Window` class instance?

I'm using Extjs-6 for developing my application. I have most than 20 controller in my application. In all of these controllers, some times, these controllers show a Ext.window.Window class instance and then user close this window(In other hands, All controller can show a popup).
Is it true that I use destroy function for closing the window ? Is this frees memory? This way don't occur leakage memory? In a sentence, What's the best wa y?

When close is called (whether as the result of user click, or programmatically), destroy is called behind the scenes, and everything in regards to preventing memory leaks is cared of for you by the framework. So, unless there are relevant bugs, you don't need to worry about that at all.

It is still a good practice, though, to get rid of any references to objects that no longer exist / in use. So, if you somewhere created a reference to you window like this:

this.win = Ext.create('Ext.window.Window'....

it will be a good idea to delete it when the window is closed:

delete this.win;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM