diff options
author | Albert Astals Cid <albert.astals@canonical.com> | 2016-10-27 17:43:43 +0200 |
---|---|---|
committer | Albert Astals Cid <albert.astals@canonical.com> | 2016-11-02 09:21:50 +0000 |
commit | 6b6f7db32e7c9ca4bdda0341994dca1212b53e20 (patch) | |
tree | 26e2790d4f8dec77e162ffeeeb9c407839e0cc40 /src/xmlpatterns/expr/qexpressionvariablereference.cpp | |
parent | 66be7fd267fa432f79a9f2bb6edc6a76285a7f39 (diff) | |
download | qtxmlpatterns-6b6f7db32e7c9ca4bdda0341994dca1212b53e20.tar.gz |
Fix memory leak
We can't have the ExpressionVariableReference/TemplateParameterReference
holding a Ptr of VariableDeclaration because the VariableDeclaration
holds a Ptr of them (in the references member) so they were referencing
eachother and the reference count never reaches 0.
Task-number: QTBUG-32745
Change-Id: I4cda6d9eccad123984f4ad35db3e56da01d4d5b1
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/xmlpatterns/expr/qexpressionvariablereference.cpp')
-rw-r--r-- | src/xmlpatterns/expr/qexpressionvariablereference.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xmlpatterns/expr/qexpressionvariablereference.cpp b/src/xmlpatterns/expr/qexpressionvariablereference.cpp index c582629..d75e68c 100644 --- a/src/xmlpatterns/expr/qexpressionvariablereference.cpp +++ b/src/xmlpatterns/expr/qexpressionvariablereference.cpp @@ -39,8 +39,8 @@ QT_BEGIN_NAMESPACE using namespace QPatternist; ExpressionVariableReference::ExpressionVariableReference(const VariableSlotID slotP, - const VariableDeclaration::Ptr &varDecl) : VariableReference(slotP) - , m_varDecl(varDecl) + const VariableDeclaration *varDecl) : VariableReference(slotP) + , m_varDecl(varDecl) { } |