From 6b6f7db32e7c9ca4bdda0341994dca1212b53e20 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 27 Oct 2016 17:43:43 +0200 Subject: 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 --- src/xmlpatterns/expr/qexpressionvariablereference.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/xmlpatterns/expr/qexpressionvariablereference.cpp') 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) { } -- cgit v1.2.1