1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

We weren't closing the device (after opening it) if "io_dev->isOpen()" returned false in the "ConnectionManager::connectDevice()" function.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2972 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
pip 2011-03-05 10:17:18 +00:00 committed by pip
parent 35475820ad
commit 7fe74cda15

View File

@ -120,6 +120,17 @@ bool ConnectionManager::connectDevice()
if (!io_dev->isOpen())
{
qDebug() << "Error: could not connect to " << connection_device.devName;
// close the device
try
{
m_connectionDevice.connection->closeDevice(m_connectionDevice.devName);
}
catch (...)
{ // handle exception
qDebug() << "Exception: m_connectionDevice.connection->closeDevice(" << m_connectionDevice.devName << ")";
}
return false;
}