Clean up the textures when deleting the content
authorAndy Shaw <andy.shaw@digia.com>
Tue, 24 Jun 2014 12:01:35 +0000 (14:01 +0200)
committerAndy Shaw <andy.shaw@digia.com>
Thu, 24 Jul 2014 11:36:36 +0000 (13:36 +0200)
Whenever the content is deleted then the textures will be recreated so the
existing list of textures should be deleted and cleared to reclaim the
memory.

Change-Id: I4fdf77817a5f4b2330414e9d113c669d18de9af8
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
src/quick/items/qquicktextnode.cpp

index da0d9cd..02e321d 100644 (file)
@@ -303,6 +303,8 @@ void QQuickTextNode::deleteContent()
     while (firstChild() != 0)
         delete firstChild();
     m_cursorNode = 0;
+    qDeleteAll(m_textures);
+    m_textures.clear();
 }
 
 #if 0