mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 19:23:24 +00:00
Delay freeing of memory after use
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
ce608b7ecf
commit
43627922e0
1 changed files with 1 additions and 1 deletions
|
@ -151,12 +151,12 @@ static int qt_serial_open(serial_t **out, dc_context_t *context, const char* dev
|
|||
}
|
||||
#endif
|
||||
if (serial_port->socket->state() != QBluetoothSocket::ConnectedState) {
|
||||
free (serial_port);
|
||||
|
||||
// Get the latest error and try to match it with one from libdivecomputer
|
||||
QBluetoothSocket::SocketError err = serial_port->socket->error();
|
||||
qDebug() << "Failed to connect to device " << devaddr << ". Device state " << serial_port->socket->state() << ". Error: " << err;
|
||||
|
||||
free (serial_port);
|
||||
switch(err) {
|
||||
case QBluetoothSocket::HostNotFoundError:
|
||||
case QBluetoothSocket::ServiceNotFoundError:
|
||||
|
|
Loading…
Add table
Reference in a new issue