diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-06-03 18:04:39 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-06-03 18:04:39 -0700 |
commit | c5437c7499514d1cc3fa7486921aecdd8d25944e (patch) | |
tree | be6fd6f08b1c6b0425b389c8efa591dc59fd02af /qt-ui/maintab.cpp | |
parent | a12b10c008c4cce58db3b128349b7d9ce1a61296 (diff) | |
download | subsurface-c5437c7499514d1cc3fa7486921aecdd8d25944e.tar.gz |
Dive edit: don't free the taglist of the master dive
We do all of our edits on a copy of the dive - but the tag_list points to
the tag_list of the master dive (based on how we create that copy of the
master dive). So only free the tag_list if it is already different from
the master dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 63e5d3a67..9200f28f5 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -960,7 +960,8 @@ void MainTab::on_tagWidget_textChanged() if (editMode == NONE) return; QString tag; - taglist_free(editedDive.tag_list); + if (editedDive.tag_list != current_dive->tag_list) + taglist_free(editedDive.tag_list); editedDive.tag_list = NULL; Q_FOREACH (tag, ui.tagWidget->getBlockStringList()) taglist_add_tag(&editedDive.tag_list, tag.toUtf8().data()); |