summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kutsan <AKutsan@luxoft.com>2014-09-13 13:19:57 +0300
committerAlexander Kutsan <AKutsan@luxoft.com>2014-09-13 13:20:20 +0300
commitb99ecacfe70733770d996a92ae5809ecd4c92e7d (patch)
tree8577f24f6254f6f3bdeae4255658bd2ee686bdf6
parent0eb36a99307e0ba7db13b737b7adb451213d0833 (diff)
downloadsdl_core-b99ecacfe70733770d996a92ae5809ecd4c92e7d.tar.gz
APPLINK-9204 USB: Core crash after unplugging usb cable
-rw-r--r--src/components/transport_manager/src/usb/libusb/usb_connection.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/components/transport_manager/src/usb/libusb/usb_connection.cc b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
index 79ba5499d0..76f2f99e4c 100644
--- a/src/components/transport_manager/src/usb/libusb/usb_connection.cc
+++ b/src/components/transport_manager/src/usb/libusb/usb_connection.cc
@@ -200,9 +200,11 @@ void UsbConnection::OnOutTransfer(libusb_transfer* transfer) {
DataSendError());
PopOutMessage();
}
- libusb_free_transfer(transfer);
- out_transfer_ = NULL;
- waiting_out_transfer_cancel_ = false;
+ if (!current_out_message_.valid()) {
+ libusb_free_transfer(transfer);
+ out_transfer_ = NULL;
+ waiting_out_transfer_cancel_ = false;
+ }
LOG4CXX_TRACE(logger_, "exit");
}