From 1ea9dc469b3052abcb4af02017f1d09e74940426 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 21 Dec 2021 15:57:46 +0100 Subject: Use global threadpool --- src/BlurhashProvider.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/BlurhashProvider.h') diff --git a/src/BlurhashProvider.h b/src/BlurhashProvider.h index 73b95eee..7f6f31c9 100644 --- a/src/BlurhashProvider.h +++ b/src/BlurhashProvider.h @@ -34,12 +34,12 @@ private: class BlurhashResponse : public QQuickImageResponse { public: - BlurhashResponse(const QString &id, const QSize &requestedSize, QThreadPool *pool) + BlurhashResponse(const QString &id, const QSize &requestedSize) { auto runnable = new BlurhashRunnable(id, requestedSize); connect(runnable, &BlurhashRunnable::done, this, &BlurhashResponse::handleDone); connect(runnable, &BlurhashRunnable::error, this, &BlurhashResponse::handleError); - pool->start(runnable); + QThreadPool::globalInstance()->start(runnable); } QQuickTextureFactory *textureFactory() const override @@ -72,9 +72,6 @@ public slots: QQuickImageResponse * requestImageResponse(const QString &id, const QSize &requestedSize) override { - return new BlurhashResponse(id, requestedSize, &pool); + return new BlurhashResponse(id, requestedSize); } - -private: - QThreadPool pool; }; -- cgit 1.4.1