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:
parent
35475820ad
commit
7fe74cda15
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user