#3 Acess violation with TIdModBusClient

closed-fixed
Pieter Polak
None
5
2010-06-23
2010-06-20
Yann Papouin
No

With Delphi 2010 + update 5 and Indy 10, I got an AV in TIdModBusClient.SendCommand in
{$IFDEF DMB_INDY10}
Buffer := RawToBytes(SendBuffer, Swap(SendBuffer.Header.RecLength) + 6);
IOHandler.WriteDirect(Buffer);
{$ELSE}

It's due to the fact that IOHandler is created only in "Connect", but If connect is nevel called (that's the case when "AutoConnect = false") then an exception will raise.

A small fix for this bug is attached.

Discussion

  • Yann Papouin
    Yann Papouin
    2010-06-20

    Patch to fix this bug

     
    Attachments
  • Pieter Polak
    Pieter Polak
    2010-06-23

    • assigned_to: nobody --> plpolak
    • status: open --> closed-fixed