summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Ogilvie <colin.ogilvie@kdab.com>2017-06-02 11:37:09 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2017-06-16 22:19:51 +0000
commit1e0685136d0debb2a3b62d9f4650c95afe41913b (patch)
treedad3af7f0395b2bbe296768dc278797379305531
parent3fc212f7cad26e310e3f560a9416ad4dfbcaca00 (diff)
Don't leak QQmlJavaScriptExpression errors
Ensure any error is deleted when the expression is Change-Id: Ibbfd28f50279d4c66830b40c5c917eb8d98f266e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--src/qml/qml/qqmlexpression.cpp1
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp1
2 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlexpression.cpp b/src/qml/qml/qqmlexpression.cpp
index b70db5ed86..1e1fbcf448 100644
--- a/src/qml/qml/qqmlexpression.cpp
+++ b/src/qml/qml/qqmlexpression.cpp
@@ -202,7 +202,6 @@ QQmlExpression::QQmlExpression(QQmlContextData *ctxt, QObject *scope,
*/
QQmlExpression::~QQmlExpression()
{
- clearError();
}
/*!
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index 17cccc0bbd..9d4e46e254 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -111,6 +111,7 @@ QQmlJavaScriptExpression::~QQmlJavaScriptExpression()
clearActiveGuards();
clearPermanentGuards();
+ clearError();
if (m_scopeObject.isT2()) // notify DeleteWatcher of our deletion.
m_scopeObject.asT2()->_s = 0;