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 <eirik.aavitsland@qt.io>
bb10
Allan Sandfeld Jensen 2020-11-06 13:18:31 +01:00
parent b5feb28d63
commit 86702fa29c
1 changed files with 1 additions and 1 deletions

View File

@ -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) {