Changeset 273 for PinConnection


Ignore:
Timestamp:
Sep 5, 2011, 12:10:12 PM (13 years ago)
Author:
george
Message:
  • Fixed: Waiting for protocol session list is empty before freeing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • PinConnection/UCommProtocol.pas

    r272 r273  
    252252
    253253procedure TCommProtocol.SetActive(const AValue: Boolean);
     254var
     255  SessionCount: Integer;
    254256begin
    255257  if FActive = AValue then Exit;
     
    265267    end;
    266268  end else begin
     269    // Wait for empty session list
     270    repeat
     271      try
     272        Sessions.Lock.Acquire;
     273        SessionCount := Sessions.Count;
     274      finally
     275        Sessions.Lock.Release;
     276      end;
     277      Sleep(1);
     278    until SessionCount = 0;
     279
    267280    FreeAndNil(RetransmitThread);
    268281  end;
Note: See TracChangeset for help on using the changeset viewer.