Fix crash when rejecting dive site changes

Emitting the stopFilterDiveSite signal caused us to clean up the UI which
reset currentDs to NULL if this was a new dive site...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-05-27 06:54:00 -07:00
parent d6e32b02f6
commit 17b7bdfd2e

View file

@ -166,14 +166,13 @@ void LocationInformationWidget::acceptChanges()
void LocationInformationWidget::rejectChanges()
{
emit stopFilterDiveSite();
Q_ASSERT(currentDs != NULL);
if (dive_site_is_empty(currentDs)) {
delete_dive_site(currentDs->uuid);
displayed_dive.dive_site_uuid = 0;
}
resetState();
emit stopFilterDiveSite();
emit informationManagementEnded();
emit coordinatesChanged();
}