Destroy Dhtmlx component

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);

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

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

        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

Method close() unloads window with attached content