mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
downloader: don't leak DiveImportedModel
Not that it matters, but there seems to be no reason to allocate DiveImportedModel on the heap and no reason to leak it after the download has finished. Removes a artifactuous comment and fixes a typo. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
5c9f3742ec
commit
dc887f6d0a
1 changed files with 7 additions and 8 deletions
|
@ -3,13 +3,13 @@
|
|||
|
||||
void cliDownloader(const char *vendor, const char *product, const char *device)
|
||||
{
|
||||
DiveImportedModel *diveImportedModel = new DiveImportedModel();
|
||||
DiveImportedModel::connect(diveImportedModel, &DiveImportedModel::downloadFinished, [] {
|
||||
DiveImportedModel diveImportedModel;
|
||||
DiveImportedModel::connect(&diveImportedModel, &DiveImportedModel::downloadFinished, [] {
|
||||
// do something useful at the end of the download
|
||||
printf("Finished\n");
|
||||
});
|
||||
|
||||
auto data = diveImportedModel->thread.data();
|
||||
auto data = diveImportedModel.thread.data();
|
||||
data->setVendor(vendor);
|
||||
data->setProduct(product);
|
||||
data->setBluetoothMode(false);
|
||||
|
@ -25,13 +25,12 @@ void cliDownloader(const char *vendor, const char *product, const char *device)
|
|||
data->setDevName(device);
|
||||
}
|
||||
|
||||
// some assumptiond - should all be configurable
|
||||
// some assumptions - should all be configurable
|
||||
data->setForceDownload(false);
|
||||
data->setSaveLog(true);
|
||||
data->setSaveDump(false);
|
||||
|
||||
// before we start, remember where the dive_table ended
|
||||
diveImportedModel->startDownload();
|
||||
diveImportedModel->waitForDownload();
|
||||
diveImportedModel->recordDives();
|
||||
diveImportedModel.startDownload();
|
||||
diveImportedModel.waitForDownload();
|
||||
diveImportedModel.recordDives();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue