From: Frederik Gladhorn Date: Mon, 19 Jan 2009 00:18:08 +0000 (+0000) Subject: backport dtor fix X-Git-Tag: v4.2.0^0 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=4c58211a63044af1d1f29e5cc31b462e31fda210;p=libqmvoc.git backport dtor fix svn path=/branches/KDE/4.2/kdeedu/libkdeedu/; revision=913264 --- diff --git a/keduvocdocument/keduvocexpression.cpp b/keduvocdocument/keduvocexpression.cpp index 10e4ee5..63d5ac3 100644 --- a/keduvocdocument/keduvocexpression.cpp +++ b/keduvocdocument/keduvocexpression.cpp @@ -45,7 +45,10 @@ public: KEduVocExpression::KEduVocExpressionPrivate::~KEduVocExpressionPrivate() { - qDeleteAll(m_translations); + QMap translations = m_translations; + // empty the translations map, otherwise removal from word type will try to access them again when they don't exist any more + m_translations.clear(); + qDeleteAll(translations); } KEduVocExpression::KEduVocExpressionPrivate::KEduVocExpressionPrivate(const KEduVocExpressionPrivate & other) diff --git a/keduvocdocument/keduvocwordtype.cpp b/keduvocdocument/keduvocwordtype.cpp index e5e32a8..65b0638 100644 --- a/keduvocdocument/keduvocwordtype.cpp +++ b/keduvocdocument/keduvocwordtype.cpp @@ -91,7 +91,6 @@ void KEduVocWordType::removeTranslation(KEduVocTranslation* translation) } } - // TODO translation(i)'s d pointer can be null. How should we fix this? // remove from cache bool found = false; foreach(int i, translation->entry()->translationIndices()) {