aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/tankitem.h
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-23 07:13:37 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-23 07:23:42 -0700
commitfb371c063352715c84d2b3b85d16d6c0937b039b (patch)
tree47d7a689c532b0a3e278f015d3f48e514428fc78 /qt-ui/profile/tankitem.h
parent3e4c30735c835e8cc27ddbbffe3c4c61141f7d2e (diff)
downloadsubsurface-fb371c063352715c84d2b3b85d16d6c0937b039b.tar.gz
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 <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/tankitem.h')
-rw-r--r--qt-ui/profile/tankitem.h5
1 files changed, 3 insertions, 2 deletions
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<QGraphicsRectItem *> rects;