From 86702fa29c4ace2f94be651db1fd7b158598be80 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 6 Nov 2020 13:18:31 +0100 Subject: [PATCH] Protect QImage colorspace transform on shutdown Adding a check here similar to fixups in other threaded qimage routines. Pick-to: 5.15 Change-Id: If7bf7aa0ef78cda15171c9038f41b281fb267dae Reviewed-by: Eirik Aavitsland --- src/gui/image/qimage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 6edf48d3ba..d05a72acc6 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4861,7 +4861,7 @@ void QImage::applyColorTransform(const QColorTransform &transform) int segments = sizeInBytes() / (1<<16); segments = std::min(segments, height()); QThreadPool *threadPool = QThreadPool::globalInstance(); - if (segments > 1 && !threadPool->contains(QThread::currentThread())) { + if (segments > 1 && threadPool && !threadPool->contains(QThread::currentThread())) { QSemaphore semaphore; int y = 0; for (int i = 0; i < segments; ++i) {