diff options
author | Alexander Kutsan <AKutsan@luxoft.com> | 2014-09-13 13:19:57 +0300 |
---|---|---|
committer | Alexander Kutsan <AKutsan@luxoft.com> | 2014-09-13 13:20:20 +0300 |
commit | b99ecacfe70733770d996a92ae5809ecd4c92e7d (patch) | |
tree | 8577f24f6254f6f3bdeae4255658bd2ee686bdf6 | |
parent | 0eb36a99307e0ba7db13b737b7adb451213d0833 (diff) | |
download | sdl_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.cc | 8 |
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"); } |