Sometime I see AV in destructor TkbmMWCustomTCPIPIndyClientTransport.Destroy;

Home Forums kbmMW Sometime I see AV in destructor TkbmMWCustomTCPIPIndyClientTransport.Destroy;

Viewing 1 reply thread
  • Author
    Posts
    • #58347
      VadimMest
      Participant
      destructor TkbmMWCustomTCPIPIndyClientTransport.Destroy;
      begin
           if FSocket<>nil then
           begin
                try
                   Disconnect;
                except
                end;
           end;
           FSocket.free;
           FSocket:=nil;
           inherited;
      end;
      
      I think it is needed to be changed on
      
      
      destructor TkbmMWCustomTCPIPIndyClientTransport.Destroy;
      begin
           if FSocket<>nil then
           begin
                try
                   Disconnect;
                except
                end;
               FSocket.free;
               FSocket:=nil;
           end;
           
           inherited;
      end;
      • This topic was modified 2 months, 1 week ago by VadimMest.
      • This topic was modified 2 months, 1 week ago by VadimMest.
    • #58358
      kimbomadsen
      Keymaster

      Logically, yes. The change certainly is not wrong, and I will implement it.
      However free is actually supposed to ignore a null self.

      It may more indicate that there is a lingering TkbmMWCustomTCPIPIndyClientTransport instance somewhere that may be attempted to be freed by two threads at the same time?

      /KBM

Viewing 1 reply thread
  • You must be logged in to reply to this topic.