summaryrefslogtreecommitdiff
path: root/src/xmlpatterns/expr/qexpressionvariablereference.cpp
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals@canonical.com>2016-10-27 17:43:43 +0200
committerAlbert Astals Cid <albert.astals@canonical.com>2016-11-02 09:21:50 +0000
commit6b6f7db32e7c9ca4bdda0341994dca1212b53e20 (patch)
tree26e2790d4f8dec77e162ffeeeb9c407839e0cc40 /src/xmlpatterns/expr/qexpressionvariablereference.cpp
parent66be7fd267fa432f79a9f2bb6edc6a76285a7f39 (diff)
downloadqtxmlpatterns-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.cpp4
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)
{
}