From 2265a27912dca82cd7bbf51dadadf25be5084174 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 15 Mar 2020 15:12:30 -0700 Subject: android/usb: better memory management Instead of relying on the std::vector staying unchanged and not freeing its members, instead keep a copy of the object in our DCDeviceData class. Signed-off-by: Dirk Hohndel --- core/downloadfromdcthread.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/downloadfromdcthread.cpp') diff --git a/core/downloadfromdcthread.cpp b/core/downloadfromdcthread.cpp index 2517b7fb6..8a3365842 100644 --- a/core/downloadfromdcthread.cpp +++ b/core/downloadfromdcthread.cpp @@ -324,9 +324,10 @@ void DCDeviceData::setDevName(const QString &devName) } #if defined(Q_OS_ANDROID) -void DCDeviceData::setUsbDevice(void *device) +void DCDeviceData::setUsbDevice(const android_usb_serial_device_descriptor &usbDescriptor) { - data.androidUsbDeviceDescriptor = device; + androidUsbDescriptor = usbDescriptor; + data.androidUsbDeviceDescriptor = &androidUsbDescriptor; } #endif -- cgit v1.2.3-70-g09d2