aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-03-14 15:28:27 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-14 10:26:52 +0100
commit4cd2f0bb2ff262bafb09eae23db919714858e4a2 (patch)
treebcc4f9a913dd9f52eae0d0e948ba3cb37b6f11b0 /src/quick/scenegraph/qsgdistancefieldglyphnode.cpp
parentd73e6d4374e21a4137b1b83fa76cf9600b214a8b (diff)
Fix memory leak with the shared distance field glyph cache.
A new glyph node instance registers its owner element with its glyph cache which in the case of the shared distance field glyph cache connects a signal from the cache to a slot on the owner, changing the text creates a new node but destroying the old node didn't remove the connection causing them to accumulate over time. In the glyph node; unregister the owner element from the cache on destruction, and in the cache only connect an owner element the first time it is registered and keep a reference count so the items can be disconnected when registrations from all nodes have been cancelled. Change-Id: Ibf32a146e146dbbf4e0556d1bd756465bd8e45ba Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/quick/scenegraph/qsgdistancefieldglyphnode.cpp')
-rw-r--r--src/quick/scenegraph/qsgdistancefieldglyphnode.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp b/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp
index 79e5c3b0f4..e049e92bae 100644
--- a/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp
+++ b/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp
@@ -76,6 +76,7 @@ QSGDistanceFieldGlyphNode::~QSGDistanceFieldGlyphNode()
glyphIndexes.append(m_allGlyphs.at(i).glyphIndex);
m_glyph_cache->release(glyphIndexes);
m_glyph_cache->unregisterGlyphNode(this);
+ m_glyph_cache->unregisterOwnerElement(ownerElement());
}
for (int i = 0; i < m_nodesToDelete.count(); ++i)