summaryrefslogtreecommitdiffstats
path: root/src/xmlpatterns/data
diff options
context:
space:
mode:
authorHonglei Zhang <honglei.zhang@nokia.com>2011-04-19 14:29:27 (GMT)
committerHonglei Zhang <honglei.zhang@nokia.com>2011-04-19 14:29:27 (GMT)
commit986ab48f1128bdd56fa408fca8f4a564e874dd4d (patch)
tree46d5e20dbf23fbbc0d95b0a4bf111f301a45fa99 /src/xmlpatterns/data
parent6dcb0028e44cba2a00c2fb867fb1757ad5b1a254 (diff)
downloadQt-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/data')
-rw-r--r--src/xmlpatterns/data/qitem_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xmlpatterns/data/qitem_p.h b/src/xmlpatterns/data/qitem_p.h
index 8184b25..fb3866e 100644
--- a/src/xmlpatterns/data/qitem_p.h
+++ b/src/xmlpatterns/data/qitem_p.h
@@ -408,6 +408,10 @@ namespace QPatternist
inline void reset()
{
+ /* Delete the atomicValue if necessary*/
+ if(isAtomicValue() && !atomicValue->ref.deref())
+ delete atomicValue;
+
/* Note that this function should be equal to the default
* constructor. */
node.model = 0;