summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/tab-widgets/maintab.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp
index 80ee2d9f4..3a2b3af89 100644
--- a/desktop-widgets/tab-widgets/maintab.cpp
+++ b/desktop-widgets/tab-widgets/maintab.cpp
@@ -862,12 +862,15 @@ void MainTab::acceptChanges()
cd->cylinder[i].type.description = copy_string(displayed_dive.cylinder[i].type.description);
}
/* if cylinders changed we may have changed gas change events
+ * and sensor idx in samples as well
* - so far this is ONLY supported for a single selected dive */
struct divecomputer *tdc = &current_dive->dc;
struct divecomputer *sdc = &displayed_dive.dc;
while(tdc && sdc) {
free_events(tdc->events);
copy_events(sdc, tdc);
+ free(tdc->sample);
+ copy_samples(sdc, tdc);
tdc = tdc->next;
sdc = sdc->next;
}