Add missing lock in QFactoryLoader

libraryList is modified in a code section that was not yet properly locked.

This was overlooked by 7ca66b1e66.

Task-number: QTBUG-42855
Change-Id: I028ad21a7df314133931f860ad49453bb2db9da0
Pick-to: 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
bb10
Alex Blasche 2020-06-02 14:11:17 +02:00
parent 43ae627f40
commit 5f7b771c4f
1 changed files with 1 additions and 0 deletions

View File

@ -296,6 +296,7 @@ void QFactoryLoader::update()
}
if (keyUsageCount || keys.isEmpty()) {
library->setLoadHints(QLibrary::PreventUnloadHint); // once loaded, don't unload
QMutexLocker locker(&d->mutex);
d->libraryList += library;
} else {
library->release();