summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/scenegraph/coreapi/qsgtexturemanager.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/scenegraph/coreapi/qsgtexturemanager.cpp b/src/scenegraph/coreapi/qsgtexturemanager.cpp
index 0b688c3..e729512 100644
--- a/src/scenegraph/coreapi/qsgtexturemanager.cpp
+++ b/src/scenegraph/coreapi/qsgtexturemanager.cpp
@@ -148,6 +148,15 @@ void QSGTextureManager::textureDestroyed(QObject *destroyed)
break;
}
}
+
+ for (QHash<QSGTextureCacheKey, QSGTexture *>::iterator it = d->cache.begin();
+ it != d->cache.end(); ++it) {
+ if (it.value() == destroyed) {
+ d->cache.remove(it.key());
+ break;
+ }
+ }
+
}
@@ -208,6 +217,7 @@ QSGTextureRef QSGTextureManager::requestUpload(const QImage &image,
QSGTexture *t = new QSGTexture();
connect(t, SIGNAL(statusChanged(int)), listener, slot);
+ connect(t, SIGNAL(destroyed(QObject*)), this, SLOT(textureDestroyed(QObject*)));
QSGTextureAsyncUpload work;
work.image = image;
@@ -282,9 +292,7 @@ void QSGTextureManager::processAsyncTextures()
}
if (time.elapsed() > d->maxUploadTime)
- return;
-
- int steps = 0;
+ break;
while (upload.progress < chunkCount && time.elapsed() < d->maxUploadTime) {
int x = (upload.progress % hChunkCount) * d->uploadChunkSize;