PDA

View Full Version : release resources Ext.Window



ser
21 Nov 2010, 1:49 AM
Can I assume that in such cases



var window = new Ext.Window ({...});
....
delete window;
window = new Ext.Window ({...})


will not leak memory?

p.s. If I close the window (not hide), then I can not re-create it
p.s2. If I hide the window then can not the next time open the update headers for tables. Just creating a new object, I can guarantee that the headers will be created with the new data

ser
23 Nov 2010, 11:52 AM
nobody knows?

Condor
24 Nov 2010, 2:13 AM
1. You can't name your variable 'window' (it's a reserved word in browsers!).

2. No, removing the variable doesn't destroy the window. You will have to call window.destroy() yourself.

ser
26 Nov 2010, 12:18 AM
In other words, I can delete a line

closeAction: 'hide',

description of the window when you close - the window is automatically destroyed and when I open the window again, I am without any checks I can re-create the window

this.wnd = new Ext.Window({...});

this is true or is there any doubt?

Condor
26 Nov 2010, 12:38 AM
Correct.

Don't forget that closing a window will destroy ALL components inside, so when creating the window again you also have to recreate all child components.

ser
26 Nov 2010, 2:03 AM
OK, Thanks.