diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-03-15 15:12:30 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-03-16 07:58:20 -0700 |
commit | 2265a27912dca82cd7bbf51dadadf25be5084174 (patch) | |
tree | 662cc7f5a56f189326960d1db0012f5212a2b505 /core/downloadfromdcthread.cpp | |
parent | 0b72495413e8b060b58b96aa6d6a0ce96baa168c (diff) | |
download | subsurface-2265a27912dca82cd7bbf51dadadf25be5084174.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'core/downloadfromdcthread.cpp')
-rw-r--r-- | core/downloadfromdcthread.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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 |