diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-11-24 06:36:06 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-11-24 06:36:06 (GMT) |
commit | 3509b9b5036a3c7d7512c7f0f3f98b2af4227fc2 (patch) | |
tree | 0880c81918a0f3b5be9afde687144598a6fb6262 /src/declarative/graphicsitems/qmlgraphicspainteditem.cpp | |
parent | 3d2b0d622908fe2c89ac1c2d5a5cb7ed96a24b6a (diff) | |
download | Qt-3509b9b5036a3c7d7512c7f0f3f98b2af4227fc2.zip Qt-3509b9b5036a3c7d7512c7f0f3f98b2af4227fc2.tar.gz Qt-3509b9b5036a3c7d7512c7f0f3f98b2af4227fc2.tar.bz2 |
Fix memory leak
QTBUG-6156
Diffstat (limited to 'src/declarative/graphicsitems/qmlgraphicspainteditem.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicspainteditem.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicspainteditem.cpp b/src/declarative/graphicsitems/qmlgraphicspainteditem.cpp index 2f467e7..948f69a 100644 --- a/src/declarative/graphicsitems/qmlgraphicspainteditem.cpp +++ b/src/declarative/graphicsitems/qmlgraphicspainteditem.cpp @@ -289,7 +289,7 @@ void QmlGraphicsPaintedItem::paint(QPainter *p, const QStyleOptionGraphicsItem * } cachesize -= d->imagecache[oldest]->area.width()*d->imagecache[oldest]->area.height(); uncached += d->imagecache[oldest]->area; - d->imagecache.removeAt(oldest); + delete d->imagecache.takeAt(oldest); } const QRegion bigger = QRegion(biggerrect) & uncached; const QVector<QRect> rects = bigger.rects(); @@ -366,7 +366,7 @@ void QmlGraphicsPaintedItem::setPixelCacheSize(int pixels) } } cachesize -= d->imagecache[oldest]->area.width()*d->imagecache[oldest]->area.height(); - d->imagecache.removeAt(oldest); + delete d->imagecache.takeAt(oldest); } } d->max_imagecache_size = pixels; |