diff options
author | Niklas Kurkisuo <ext-niklas.kurkisuo@nokia.com> | 2010-12-03 11:50:36 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2011-05-13 13:56:29 (GMT) |
commit | 23267553627ac3c4cbcd918283bee8e665deeff9 (patch) | |
tree | 9301d656c9cd80c81192538231f0731c0b3c7850 /src/xmlpatterns/expr/qevaluationcache_p.h | |
parent | 3d27a19ca009836b812b59c3359db1369d391181 (diff) | |
download | Qt-23267553627ac3c4cbcd918283bee8e665deeff9.zip Qt-23267553627ac3c4cbcd918283bee8e665deeff9.tar.gz Qt-23267553627ac3c4cbcd918283bee8e665deeff9.tar.bz2 |
Fix memory leak in QXmlQuery::setQuery.
There is a circular reference dependency between VariableDeclaration
and the classes EvaluationCache, ExpressionVariableReference and
TemplateParameterReference. By removing the explicitly shared pointer
of VariableDeclaration in these classes the circle is broken and memory
is freed correctly.
Task-number: QT-4106
Integrated-by: David Boddie
Diffstat (limited to 'src/xmlpatterns/expr/qevaluationcache_p.h')
-rw-r--r-- | src/xmlpatterns/expr/qevaluationcache_p.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xmlpatterns/expr/qevaluationcache_p.h b/src/xmlpatterns/expr/qevaluationcache_p.h index 86aeaf8..6a2504e 100644 --- a/src/xmlpatterns/expr/qevaluationcache_p.h +++ b/src/xmlpatterns/expr/qevaluationcache_p.h @@ -97,7 +97,7 @@ namespace QPatternist { public: EvaluationCache(const Expression::Ptr &operand, - const VariableDeclaration::Ptr &varDecl, + const VariableDeclaration *varDecl, const VariableSlotID slot); virtual Item evaluateSingleton(const DynamicContext::Ptr &context) const; @@ -124,7 +124,7 @@ namespace QPatternist private: static DynamicContext::Ptr topFocusContext(const DynamicContext::Ptr &context); - const VariableDeclaration::Ptr m_declaration; + const VariableDeclaration *m_declaration; /** * This variable must not be called m_slot. If it so, a compiler bug on * HP-UX-aCC-64 is triggered in the constructor initializor. See the |