diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2017-11-11 19:40:47 +0100 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-11-11 21:01:42 +0100 |
commit | efabf0a55cfe8be542fc9c694721d32ecd86583c (patch) | |
tree | 34aab5ba9a0475a0414ea17ee3969fea5fcb3725 /desktop-widgets/downloadfromdivecomputer.h | |
parent | 35c5016777d902a2c2ae62bc135e5af0c05fbc14 (diff) | |
download | subsurface-efabf0a55cfe8be542fc9c694721d32ecd86583c.tar.gz |
Fix memory leak in download-from-dive-computer widget
Instead of (re)allocating the vendor and product models, use the
setStringList method on sub objects.
Even though only a theoretical problem, the model objects are moved
in front of the ui object, so that the widgets referencing the models
are destroyed first.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/downloadfromdivecomputer.h')
-rw-r--r-- | desktop-widgets/downloadfromdivecomputer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/desktop-widgets/downloadfromdivecomputer.h b/desktop-widgets/downloadfromdivecomputer.h index a004215a0..ec3ac266e 100644 --- a/desktop-widgets/downloadfromdivecomputer.h +++ b/desktop-widgets/downloadfromdivecomputer.h @@ -60,14 +60,14 @@ private: void markChildrenAsEnabled(); void updateDeviceEnabled(); + QStringListModel vendorModel; + QStringListModel productModel; Ui::DownloadFromDiveComputer ui; DownloadThread thread; bool downloading; int previousLast; - QStringListModel *vendorModel; - QStringListModel *productModel; void fill_device_list(int dc_type); QTimer *timer; bool dumpWarningShown; |