Dhtmlxwindow close fail when layout is attached

Hello !

i have a problem with ie11, when i close my dhtmlxwindow with a close() method when a layout is attached , the ie console display an error : object can’t handle property or method “detachEvent”
i’ve tryied everything , my last solution which in my code is to kill the attached layout before closing the window
i’m using 3.6 dhtmlx version
please help !

my code :

    var dhxWin = new dhtmlXWindows();
    var wdow = dhxWin.createWindow('TxWriteForm', 100, 100, 900, 398);
    wdow.center();
    wdow.denyResize();

    layout = wdow.attachLayout("2E");
    layout.setImagePath('../../../resources/theme/img/dhtmlx/layout/');
    layout.setAutoSize("");
    layout.setSkin("dhx_skyblue");

    var lCenter = layout.cells("a");
    lCenter.hideHeader();
    lCenter.setHeight('*');
    lCenter.attachHTMLString('<div id="mainDivS"></div>');

    var lBottom = layout.cells("b");
    lBottom.hideHeader();
    lBottom.setHeight('30');
    lBottom.fixSize(0, 1);
    lBottom.attachHTMLString('<div id="id_div_btns">'
        + '<input type="button" id="ok" class="cl_btn_action" value="OK"/>'
        + '<input type="button" class="cl_btn_action" id="cancel" value="Cancel"/>'
        + '</div>');
 //associate event with button ok
    J("#ok").click(OnButtonClick);

    //associate event with button cancel
    J("#cancel").click(OnButtonClick)

    function OnButtonClick() {
        layout.unload();
        layout = null;
        wdow.close();
    }

Best regards , Nassim

Hello
Do you really need to close() window? You can hide()/show() it without content’s destruction. When you close it - it destructs global dhtmlXLayoutObject