anchor.diff:    xcfg: TXMLConfigStorage;
     i: NativeInt;
   begin
  -  // TODO-cbugfix: possible loading AV, xml saved after undocking some widgets, xml file abnormal size, seems to be related to Anchordocking itself, not its usage.
     for i:= 0 to fWidgList.Count-1 do
     begin
       if not fWidgList.widget[i].isDockable then continue;
  
positive.code:   end;
    //
    forceDirectory(extractFilePath(aFilename));
    xcfg := TXMLConfigStorage.Create(aFilename, false);
    try
      DockMaster.SaveLayoutToConfig(xcfg);
      xcfg.WriteToDisk;
    finally
      xcfg.Free;
    end;
  
negative.code:   end;
    //
    forceDirectory(getCoeditDocPath);
    xcfg := TXMLConfigStorage.Create(getCoeditDocPath + 'docking.xml.tmp', false);
    try
      DockMaster.SaveLayoutToConfig(xcfg);
      xcfg.WriteToDisk;
      // TODO: this when AnchorDocking wiont save anymore invalid layout
      with TMemoryStream.Create do try
        LoadFromFile(getCoeditDocPath + 'docking.xml.tmp');
        if Size < 10000 then
        begin
          SaveToFile(getCoeditDocPath + 'docking.xml');
          SysUtils.DeleteFile(getCoeditDocPath + 'docking.xml.tmp');
        end;
      finally
        free;
      end;
    finally
      xcfg.Free;
    end;
  