Fixed an issue where a parent thread was closed from which the _connectionWatcherand _reader child threads were started, and the child thread continued its work, resulting in a suspended state of one or more threads after the main form of the application UI was closed.
.
.
The problem became obvious in WinForms dot-net 7.0 when I created and configured several SerialPortInputobjects on a child form, called Connectmethod for all of them, and then called Disconnectfor all of them and closed first the child form and then the main form and the process remained hanging in Task Manager.
Thank you for this pull request, I was also facing a similar issue with automation programs in HomeGenie. Using IsBackground=true will fix that as well.
Fixed an issue where a parent thread was closed from which the
_connectionWatcher
and_reader
child threads were started, and the child thread continued its work, resulting in a suspended state of one or more threads after the main form of the application UI was closed. . . The problem became obvious in WinForms dot-net 7.0 when I created and configured severalSerialPortInput
objects on a child form, calledConnect
method for all of them, and then calledDisconnect
for all of them and closed first the child form and then the main form and the process remained hanging in Task Manager.