summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativeengine_p.h
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-08-17 13:38:33 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2010-08-19 08:47:11 (GMT)
commitf894befedf669fb864a500b0aa395157ff0fb929 (patch)
treec5bc53dcd98dbce2471e23e7014c2a30247e8941 /src/declarative/qml/qdeclarativeengine_p.h
parentf6cfafde26b4735965be8df0d11e9d7c297c75b9 (diff)
downloadQt-f894befedf669fb864a500b0aa395157ff0fb929.zip
Qt-f894befedf669fb864a500b0aa395157ff0fb929.tar.gz
Qt-f894befedf669fb864a500b0aa395157ff0fb929.tar.bz2
QDeclarativeImageProvider: Do not keep the global declarative mutex locked when processing.
The point is to be able to process images in a thread. If the mutex is locked, this is useless. Use case is a slow QDeclarativeImageProvider that generates thumbmails from large files. Even with the asynchronous attribute set to true, the gui thread would be blocked by the mutex. By using QSharedPointer, I also fix the leak of the providers (which were not deleted) Reviewed-by: Martin Jones
Diffstat (limited to 'src/declarative/qml/qdeclarativeengine_p.h')
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h
index 3b5dd5a..db2db35 100644
--- a/src/declarative/qml/qdeclarativeengine_p.h
+++ b/src/declarative/qml/qdeclarativeengine_p.h
@@ -232,7 +232,7 @@ public:
mutable QNetworkAccessManager *networkAccessManager;
mutable QDeclarativeNetworkAccessManagerFactory *networkAccessManagerFactory;
- QHash<QString,QDeclarativeImageProvider*> imageProviders;
+ QHash<QString,QSharedPointer<QDeclarativeImageProvider> > imageProviders;
QDeclarativeImageProvider::ImageType getImageProviderType(const QUrl &url);
QImage getImageFromProvider(const QUrl &url, QSize *size, const QSize& req_size);
QPixmap getPixmapFromProvider(const QUrl &url, QSize *size, const QSize& req_size);