From c5437c7499514d1cc3fa7486921aecdd8d25944e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 3 Jun 2014 18:04:39 -0700 Subject: 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 --- qt-ui/maintab.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qt-ui') 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()); -- cgit v1.2.3-70-g09d2