QFactoryLoader: Release unused libraries.
Task-number: QTBUG-31476 Change-Id: Ib2eb076afaa21ab1fdc12944f80483e3de260d4b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
parent
cf8647d6aa
commit
732dcfe7fd
@ -183,7 +183,7 @@ void QFactoryLoader::update()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->libraryList += library;
|
int keyUsageCount = 0;
|
||||||
for (int k = 0; k < keys.count(); ++k) {
|
for (int k = 0; k < keys.count(); ++k) {
|
||||||
// first come first serve, unless the first
|
// first come first serve, unless the first
|
||||||
// library was built with a future Qt version,
|
// library was built with a future Qt version,
|
||||||
@ -198,8 +198,13 @@ void QFactoryLoader::update()
|
|||||||
int qt_version = (int)library->metaData.value(QLatin1String("version")).toDouble();
|
int qt_version = (int)library->metaData.value(QLatin1String("version")).toDouble();
|
||||||
if (!previous || (prev_qt_version > QT_VERSION && qt_version <= QT_VERSION)) {
|
if (!previous || (prev_qt_version > QT_VERSION && qt_version <= QT_VERSION)) {
|
||||||
d->keyMap[key] = library;
|
d->keyMap[key] = library;
|
||||||
|
++keyUsageCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (keyUsageCount || keys.isEmpty())
|
||||||
|
d->libraryList += library;
|
||||||
|
else
|
||||||
|
library->release();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user