import: free dc_descriptor in new device_data_t destructor

It seems that smartrak was the only part of the code that cared
about freeing the dc_descriptor. Make that a general feature
of the new device_data_t destructor, which we could implement
now that things are in C++.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-02 21:59:14 +02:00 committed by bstoeger
parent 01306224ff
commit e29a0c1b29
3 changed files with 14 additions and 8 deletions

View file

@ -842,11 +842,6 @@ static dc_status_t prepare_data(int data_model, const char *serial, dc_family_t
}
}
static void device_data_free(device_data_t &dev_data)
{
dc_descriptor_free(dev_data.descriptor);
}
/*
* Returns a buffer prepared for libdc parsing.
* Aladin and memomouse dives were imported from datatrak, so they lack of a
@ -1048,7 +1043,6 @@ extern "C" void smartrak_import(const char *file, struct divelog *log)
concat(&smtkdive->notes, "\n", std::string((char *)col[coln(REMARKS)]->bind_ptr));
record_dive_to_table(smtkdive, log->dives);
device_data_free(devdata);
}
mdb_free_catalog(mdb_clon);
mdb->catalog = NULL;