fix: exception could be thrown in serial iohandlers

Dieser Commit ist enthalten in:
Reinder Feenstra 2024-06-01 23:21:43 +02:00
Ursprung ff7e2971fc
Commit 65807f3ee7
4 geänderte Dateien mit 20 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -39,7 +39,11 @@ SerialIOHandler::SerialIOHandler(Kernel& kernel, const std::string& device, uint
SerialIOHandler::~SerialIOHandler()
{
if(m_serialPort.is_open())
m_serialPort.close();
{
boost::system::error_code ec;
m_serialPort.close(ec);
// ignore the error
}
}
void SerialIOHandler::start()

Datei anzeigen

@ -41,7 +41,11 @@ SerialIOHandler::SerialIOHandler(Kernel& kernel, const std::string& device, uint
SerialIOHandler::~SerialIOHandler()
{
if(m_serialPort.is_open())
m_serialPort.close();
{
boost::system::error_code ec;
m_serialPort.close(ec);
// ignore the error
}
}
void SerialIOHandler::start()

Datei anzeigen

@ -39,7 +39,11 @@ SerialIOHandler::SerialIOHandler(Kernel& kernel, const std::string& device, uint
SerialIOHandler::~SerialIOHandler()
{
if(m_serialPort.is_open())
m_serialPort.close();
{
boost::system::error_code ec;
m_serialPort.close(ec);
// ignore the error
}
}
void SerialIOHandler::start()

Datei anzeigen

@ -39,7 +39,11 @@ SerialIOHandler::SerialIOHandler(Kernel& kernel, const std::string& device, uint
SerialIOHandler::~SerialIOHandler()
{
if(m_serialPort.is_open())
m_serialPort.close();
{
boost::system::error_code ec;
m_serialPort.close(ec);
// ignore the error
}
}
void SerialIOHandler::start()