[Interest] Crash in QSerialPort when closing?
Murphy, Sean
smurphy at walbro.com
Thu Oct 30 14:42:39 CET 2014
> Closing a device within a read slot sounds dodgy anyway. In these cases, I usually do
> QTimer::singleShot(0, ...) and do the close in that slot.
I thought about doing the single shot as well.
Is there a more concrete reason (other than it sounding "dodgy") that you feel like the way I'm currently doing it is not a good idea?
In my use case, I've already sent the "I would like to disconnect" command to the external device, and I'm waiting for a short acknowledge response. In my readyRead() slot, I validate that response, which means that the external device is in an idle state, listening, so I'm not expecting to receive any more bytes. So at this point, I'm ready to close the connection.
Sean
More information about the Interest
mailing list