diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2015-09-09 18:34:49 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-09-09 09:14:16 -0700 |
commit | 43627922e0c7ba50b7db95175678ae1a9f7dbdce (patch) | |
tree | 184649a3348f40881f9ac3389ae037acd2b265a6 /qtserialbluetooth.cpp | |
parent | ce608b7ecf795865906082a5af89d724896d1dea (diff) | |
download | subsurface-43627922e0c7ba50b7db95175678ae1a9f7dbdce.tar.gz |
Delay freeing of memory after use
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qtserialbluetooth.cpp')
-rw-r--r-- | qtserialbluetooth.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qtserialbluetooth.cpp b/qtserialbluetooth.cpp index 45fc8d1ec..ebbd1d451 100644 --- a/qtserialbluetooth.cpp +++ b/qtserialbluetooth.cpp @@ -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: |