Fix crash when manually adding a dive

When a manually added dive is saved we cancel the plan. In that process
we throw away the cylinders which triggers a redraw of the profile. Which
tries to access the diveplan and its data points that have already been
freed. BOOM.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-04-18 10:21:58 -07:00
parent cb4daa85c3
commit 0a018f30de

View file

@ -1404,6 +1404,7 @@ void DivePlannerPointsModel::cancelPlan()
free(stagingDive);
setPlanMode(NOTHING);
stagingDive = NULL;
diveplan.dp = NULL;
CylindersModel::instance()->setDive(current_dive);
CylindersModel::instance()->update();
}