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>
This commit is contained in:
Berthold Stoeger 2017-11-11 19:40:47 +01:00 committed by Lubomir I. Ivanov
parent 35c5016777
commit efabf0a55c
2 changed files with 8 additions and 17 deletions

View file

@ -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;