diff options
author | Honglei Zhang <honglei.zhang@nokia.com> | 2011-04-19 14:29:27 (GMT) |
---|---|---|
committer | Honglei Zhang <honglei.zhang@nokia.com> | 2011-04-19 14:29:27 (GMT) |
commit | 986ab48f1128bdd56fa408fca8f4a564e874dd4d (patch) | |
tree | 46d5e20dbf23fbbc0d95b0a4bf111f301a45fa99 /src/xmlpatterns/expr/qdynamiccontextstore.cpp | |
parent | 6dcb0028e44cba2a00c2fb867fb1757ad5b1a254 (diff) | |
download | Qt-986ab48f1128bdd56fa408fca8f4a564e874dd4d.zip Qt-986ab48f1128bdd56fa408fca8f4a564e874dd4d.tar.gz Qt-986ab48f1128bdd56fa408fca8f4a564e874dd4d.tar.bz2 |
Fix memory leak bugs in XmlPatterns
In XmlPatterns implementation, QExplicitlySharedDataPointer and
QSharedData classes are widely used. The over use of these classes
has cuased couple of cyclic references. Some codes are refactored
to use plain C++ pointer to break the reference loop.
Task-number: QTBUG-15191
Reviewed-by: Laszlo Agocs and Sami Merila
Diffstat (limited to 'src/xmlpatterns/expr/qdynamiccontextstore.cpp')
-rw-r--r-- | src/xmlpatterns/expr/qdynamiccontextstore.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/xmlpatterns/expr/qdynamiccontextstore.cpp b/src/xmlpatterns/expr/qdynamiccontextstore.cpp index 762b7d6..7e7ead7 100644 --- a/src/xmlpatterns/expr/qdynamiccontextstore.cpp +++ b/src/xmlpatterns/expr/qdynamiccontextstore.cpp @@ -51,24 +51,24 @@ using namespace QPatternist; DynamicContextStore::DynamicContextStore(const Expression::Ptr &operand, const DynamicContext::Ptr &context) : SingleContainer(operand), - m_context(context) + m_context(context.data()) { Q_ASSERT(context); } bool DynamicContextStore::evaluateEBV(const DynamicContext::Ptr &) const { - return m_operand->evaluateEBV(m_context); + return m_operand->evaluateEBV(DynamicContext::Ptr(m_context)); } Item::Iterator::Ptr DynamicContextStore::evaluateSequence(const DynamicContext::Ptr &) const { - return m_operand->evaluateSequence(m_context); + return m_operand->evaluateSequence(DynamicContext::Ptr(m_context)); } Item DynamicContextStore::evaluateSingleton(const DynamicContext::Ptr &) const { - return m_operand->evaluateSingleton(m_context); + return m_operand->evaluateSingleton(DynamicContext::Ptr(m_context)); } SequenceType::Ptr DynamicContextStore::staticType() const |