Destroy Dhtmlx component

Hello,
I have one page aplication based fully on dhtmlx components and Im not sure how to correct use(mainly destroy) components.
My code is like this:

function loadModule(idModule,nameModule){
var win = mainWin.createWindow(“w”+idModule, 0,0 , 800, 600);
win.setText(nameModule);
win.etc…

      var main_layout = win.attachLayout("2U");
           etc.....

       [b]function loadData(layoutType){
            var layout = main_layout.cells("b").attachLayout(layoutType);                
        }[/b]

        here I call (repeatedly) loadData() and var layoutType will be sometimes 2U, sometimes 1C and each cell will contains menu,grid... Is it correct - (mainly for memory leak a so...)? Or is it necessary call (on reload) something like - layout.destructor();... And what about var win on close? I use only win.close();(not use win.unload();).

}
Thank you Peter

Hello
Method close() unloads window with attached content