anchor.diff:   F_Main.LogStatus('Centrla: odpojovn...');
    F_Main.S_Intellibox_connect.Brush.Color := clBlue;
    Application.ProcessMessages();
  -
  - if (not Self.force_close) then
  -  begin
  -   GetMem(data, sizeof(integer));
  -   for i := 0 to _MAX_ADDR-1 do
  -    begin
  -     if (HVDb.HVozidla[i] = nil) then continue;
  -
  -     HVDb.HVozidla[i].Slot.stolen := false;
  -     if (HVDb.HVozidla[i].Slot.prevzato) then
  -      begin
  -       Integer(data^) := i;
  -       Self.callback_err := TTrakce.GenerateCallback(Self.NouzReleaseCallbackErr, data);
  -       Self.OdhlasitLoko(HVDb.HVozidla[i]);
  -      end;
  -     while (HVDb.HVozidla[i].Slot.prevzato) do
  -      begin
  -       sleep(1);
  -       Application.ProcessMessages;
  -      end;
  -    end;
  -   FreeMem(data);
  -  end;//if not Self.force_close
  -
    Self.Trakce.BeforeClose();   // smaze buffer historie
   end;//procedure
   
  
positive.code: end;//procedure
  
  procedure TTrkGUI.BeforeClose(Sender:TObject);
  var i:Integer;
      data:Pointer;
  begin
   F_Main.A_Trk_Connect.Enabled       := false;
   F_Main.A_Trk_Disconnect.Enabled    := false;
  
negative.code:      procedure AfterOpen(Sender:TObject);
       procedure BeforeClose(Sender:TObject);
       procedure AfterClose(Sender:TObject);
  
       procedure NouzReleaseLoko();
  
       procedure ConnectChange(Sender: TObject; addr:Integer; code:TConnect_code;
          data:Pointer);                                                          // event volany z .Trace pri zmene majitele lokomotivy (loko prevzato, ukradeno, nedostupne, ...)
  