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>
This commit is contained in:
Dirk Hohndel 2014-08-23 07:13:37 -07:00
parent 3e4c30735c
commit fb371c0633
2 changed files with 20 additions and 12 deletions

View file

@ -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;