summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/device.h1
-rw-r--r--core/divecomputer.cpp5
-rw-r--r--core/divelist.c2
3 files changed, 8 insertions, 0 deletions
diff --git a/core/device.h b/core/device.h
index c1e767bee..65b715ba1 100644
--- a/core/device.h
+++ b/core/device.h
@@ -14,6 +14,7 @@ extern void set_dc_deviceid(struct divecomputer *dc, unsigned int deviceid);
extern void create_device_node(const char *model, uint32_t deviceid, const char *serial, const char *firmware, const char *nickname);
extern void call_for_each_dc(void *f, void (*callback)(void *, const char *, uint32_t,
const char *, const char *, const char *), bool select_only);
+extern void clear_device_nodes();
#ifdef __cplusplus
}
diff --git a/core/divecomputer.cpp b/core/divecomputer.cpp
index 9dfe5a373..369981d07 100644
--- a/core/divecomputer.cpp
+++ b/core/divecomputer.cpp
@@ -85,6 +85,11 @@ extern "C" void create_device_node(const char *model, uint32_t deviceid, const c
dcList.addDC(model, deviceid, nickname, serial, firmware);
}
+extern "C" void clear_device_nodes()
+{
+ dcList.dcs.clear();
+}
+
static bool compareDCById(const DiveComputerNode &a, const DiveComputerNode &b)
{
return a.deviceId < b.deviceId;
diff --git a/core/divelist.c b/core/divelist.c
index 994170570..c53bcb983 100644
--- a/core/divelist.c
+++ b/core/divelist.c
@@ -3,6 +3,7 @@
#include "subsurface-string.h"
#include "deco.h"
+#include "device.h"
#include "divesite.h"
#include "divelist.h"
#include "fulltext.h"
@@ -1367,6 +1368,7 @@ void clear_dive_file_data()
}
clear_dive(&displayed_dive);
+ clear_device_nodes();
reset_min_datafile_version();
clear_git_id();