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.h | |
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.h')
-rw-r--r-- | core/downloadfromdcthread.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/core/downloadfromdcthread.h b/core/downloadfromdcthread.h index f142a4243..239811749 100644 --- a/core/downloadfromdcthread.h +++ b/core/downloadfromdcthread.h @@ -12,6 +12,10 @@ #if BT_SUPPORT #include "core/btdiscovery.h" #endif +#if defined(Q_OS_ANDROID) +#include "core/serial_usb_android.h" +#endif + /* Helper object for access of Device Data in QML */ class DCDeviceData { public: @@ -50,9 +54,12 @@ public: void setSaveDump(bool dumpMode); void setSaveLog(bool saveLog); #if defined(Q_OS_ANDROID) - void setUsbDevice(void *device); + void setUsbDevice(const android_usb_serial_device_descriptor &usbDescriptor); #endif private: +#if defined(Q_OS_ANDROID) + struct android_usb_serial_device_descriptor androidUsbDescriptor; +#endif device_data_t data; // Bluetooth name is managed outside of libdivecomputer |