Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-59050

QModbusRtuSerialMaster never close on disconnect

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.7.1, 5.8.0
    • Fix Version/s: 5.6.3, 5.9.0 Beta 1
    • Component/s: SerialBus: MOD Bus
    • Labels:
      None

      Description

      Because of fix of QTBUG-56009 there arisen bug when on disconnecting QModbusRtuSerialMaster would never close and would always be in QModbusDevice::ClosingState.
      Source code to illustrate:

      qmodbusdevice.cpp
      void QModbusDevice::disconnectDevice()
      {
          setState(QModbusDevice::ClosingState);
       
          //Unconnected is set by backend -> might be delayed by event loop
          close();
      }
      
      qmodbusrtuserialmaster.cpp
      void QModbusRtuSerialMaster::close()
      {
          if (state() == QModbusDevice::UnconnectedState ||
              state() == QModbusDevice::ClosingState) {
              return;
          }
       
          setState(QModbusDevice::ClosingState);
      // ...
      }
      

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-59050
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              michaelwinkelmann Michael Winkelmann
              Reporter:
              konstantin_shtepa Konstantin Shtepa
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes