From bfb347a463ceff05628abea6a105f6c83f100725 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Thu, 26 May 2011 15:12:37 +0200 Subject: [PATCH] Textures not scheduled for deletion while scrolling QML view. This happened when scrolling a view using an Image delegate (containing QSGTexture). All textures were deleted at exit, but it is important to immediately schedule the texture for deletion whenever the delegate is destroyed to avoid unnecessary high memory consumption. Task-number: QTBUG-19511 Reviewed-by: gunnar --- src/declarative/util/qdeclarativepixmapcache.cpp | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/declarative/util/qdeclarativepixmapcache.cpp b/src/declarative/util/qdeclarativepixmapcache.cpp index fa3be22..f138741 100644 --- a/src/declarative/util/qdeclarativepixmapcache.cpp +++ b/src/declarative/util/qdeclarativepixmapcache.cpp @@ -876,6 +876,10 @@ bool QDeclarativePixmapReply::event(QEvent *event) int QDeclarativePixmapData::cost() const { + if (texture) { + const QSize textureSize = texture->textureSize(); + return textureSize.width() * textureSize.height(); + } return (pixmap.width() * pixmap.height() * pixmap.depth()) / 8; } -- 1.7.2.5