delphidelphi-10.2-tokyotethering

Delphi tethering PairedManagers out of range


Delphi 10.2.3

procedure TMainForm.FormDestroy(Sender: TObject);
var i: Integer;

begin
  try

    CodeSite.Send('In FormDestroy, MyTetheringAppProfile.Disconnect() has ' + IntToStr(MyTetheringManager.RemoteProfiles.Count) + ' profiles.');

    for i:= MyTetheringManager.PairedManagers.Count-1 downto 0 do
      MyTetheringManager.UnPairManager(MyTetheringManager.PairedManagers[i]);

UnPairManager() throws a range exception error.

I don't see how that is possible as there is only one manager. i=0 and MyTetheringManager.PairedManagers.Count=1 when tracing into the code.

How is it possible for this to be out of range?


Solution

  • Once I connected both apps to same Codesite, I could see that the "server" side of the tethering was disconnecting during the client's FormDestroy code.