mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
01306224ff
commit
e29a0c1b29
3 changed files with 14 additions and 8 deletions
|
@ -55,6 +55,16 @@ static int current_gas_index;
|
|||
#define INFO(fmt, ...) report_info("INFO: " fmt, ##__VA_ARGS__)
|
||||
#define ERROR(fmt, ...) report_info("ERROR: " fmt, ##__VA_ARGS__)
|
||||
|
||||
device_data_t::device_data_t()
|
||||
{
|
||||
}
|
||||
|
||||
device_data_t::~device_data_t()
|
||||
{
|
||||
if (descriptor)
|
||||
dc_descriptor_free(descriptor);
|
||||
}
|
||||
|
||||
/*
|
||||
* Directly taken from libdivecomputer's examples/common.c to improve
|
||||
* the error messages resulting from libdc's return codes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue