From d3867af1b9e9ea920e283a2e3f5629f48b6a8cf1 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Sun, 30 Oct 2022 09:06:00 +0100 Subject: [PATCH] profile: clear dive pointer when clearing profile Try to avoid stale pointers when resetting the dive data. Signed-off-by: Berthold Stoeger --- profile-widget/profilewidget2.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 89d1b2840..0d379d797 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -397,6 +397,8 @@ void ProfileWidget2::clear() handles.clear(); gases.clear(); empty = true; + d = nullptr; + dc = 0; } void ProfileWidget2::setProfileState(const dive *dIn, int dcIn)