From fb371c063352715c84d2b3b85d16d6c0937b039b Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 23 Aug 2014 07:13:37 -0700 Subject: TankBar: don't risk dereferencing stale pointers Basically we could end up in a situation where the plotInfo is no longer valid, yet the model changes and triggers a redraw before the new data is passed into the TankBar. Instead of chasing that race condition it seemed much easier to just copy the plot_data entries and the gas information in the dive. Fixes #716 Signed-off-by: Dirk Hohndel --- qt-ui/profile/tankitem.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'qt-ui/profile/tankitem.h') diff --git a/qt-ui/profile/tankitem.h b/qt-ui/profile/tankitem.h index 615a7017d..f8d4ac9f8 100644 --- a/qt-ui/profile/tankitem.h +++ b/qt-ui/profile/tankitem.h @@ -28,8 +28,9 @@ private: DivePlotDataModel *dataModel; DiveCartesianAxis *hAxis; int hDataColumn; - struct dive *dive; - struct plot_info *pInfo; + struct dive diveCylinderStore; + struct plot_data *pInfoEntry; + int pInfoNr; qreal yPos, height; QBrush air, nitrox, trimix; QList rects; -- cgit v1.2.3-70-g09d2