QModbusDevice::disconnectDevice(): return early in ClosingState


As the comment mentions, the UnconnectedState can be set by the
backend implementation with a delay due to event loop handling.
That is, for example, the case for the TCP-based client.

In such cases, there is a possibility that disconnectDevice() will be
called for the second time while the device is still in a ClosingState.
We do not need to call the backend close() implementation again, and
can just return early in such cases.

If the device is already in a ClosingState, then there's no need to
call the backend close() implementation again.

Change-Id: I0bde71343c1febaa863aff48e98a00a324689b2d
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
commit973ff28cb89b8237f254cee006d7788752344907
parentfcbe6a424a7dd0cb7d141959d0d67b28ce1d1217
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeMon, 28 Apr 2025 11:39:46 +0000