TextEditor: Avoid removing text marks that were not added to hash

TextMarks with empty file names are not added, no reason to remove them.

Change-Id: I8647deaa1136294d2f7c3c63337d967afea675c2
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Orgad Shaneh
2017-07-19 12:56:17 +03:00
committed by Orgad Shaneh
parent a54cba428a
commit c2ecee517e

View File

@@ -88,7 +88,8 @@ TextMark::TextMark(const QString &fileName, int lineNumber, Id category, double
TextMark::~TextMark() TextMark::~TextMark()
{ {
TextMarkRegistry::remove(this); if (!m_fileName.isEmpty())
TextMarkRegistry::remove(this);
if (m_baseTextDocument) if (m_baseTextDocument)
m_baseTextDocument->removeMark(this); m_baseTextDocument->removeMark(this);
m_baseTextDocument = 0; m_baseTextDocument = 0;