From 8db54c45a4b3154491234f188d4f4f9a6d71d321 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Wed, 25 Jan 2017 22:54:13 +0800 Subject: [PATCH] bugfix: do not use reference to hold return value from capturedTexts() Signed-off-by: Le Tan --- src/hgmarkdownhighlighter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hgmarkdownhighlighter.cpp b/src/hgmarkdownhighlighter.cpp index 04f290fd..95bbfb12 100644 --- a/src/hgmarkdownhighlighter.cpp +++ b/src/hgmarkdownhighlighter.cpp @@ -219,7 +219,7 @@ void HGMarkdownHighlighter::highlightLinkWithSpacesInURL(const QString &p_text) while (index >= 0) { Q_ASSERT(regExp.captureCount() == 1); int length = regExp.matchedLength(); - const QString &capturedText = regExp.capturedTexts()[1]; + QString capturedText = regExp.capturedTexts()[1]; if (capturedText.contains(' ')) { if (p_text[index] == '!' && m_imageFormat.isValid()) { setFormat(index, length, m_imageFormat);