Skip to content

Commit

Permalink
Don't leak QQmlJavaScriptExpression errors
Browse files Browse the repository at this point in the history
Ensure any error is deleted when the expression is

Change-Id: Ibbfd28f50279d4c66830b40c5c917eb8d98f266e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
  • Loading branch information
cogilvie authored and dangelog committed Jun 16, 2017
1 parent 3fc212f commit 1e06851
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion src/qml/qml/qqmlexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ QQmlExpression::QQmlExpression(QQmlContextData *ctxt, QObject *scope,
*/
QQmlExpression::~QQmlExpression()
{
clearError();
}

/*!
Expand Down
1 change: 1 addition & 0 deletions src/qml/qml/qqmljavascriptexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ QQmlJavaScriptExpression::~QQmlJavaScriptExpression()

clearActiveGuards();
clearPermanentGuards();
clearError();
if (m_scopeObject.isT2()) // notify DeleteWatcher of our deletion.
m_scopeObject.asT2()->_s = 0;

Expand Down

0 comments on commit 1e06851

Please sign in to comment.