QFactoryLoader: Do not call unload() automatically

QPluginLoader does not call unload() on the QLibraryPrivate without an
explicit call to QPluginLoader::unload(). QFactoryLoader should behave
the same. We want to avoid unload() if possible as we generally don't
unload plugins and the resulting behavior varies between platforms. In
particular, macOS does make the address space of libraries only the
plugin links to inaccessible on close() even if RTLD_NODELETE is given.

For code that actually wants to unload(), an explicit function to do so
could be added. As QFactoryLoader is private API, there is no need to do
that until such a case is found.

Change-Id: I4e57259a9dcb4ceb60dfbfeda55abc0b995f436a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
bb10
Ulf Hermann 2020-06-30 10:31:32 +02:00
parent 062318feb2
commit 5a5c20ad40
1 changed files with 1 additions and 4 deletions

View File

@ -178,11 +178,8 @@ Q_GLOBAL_STATIC(QRecursiveMutex, qt_factoryloader_mutex)
QFactoryLoaderPrivate::~QFactoryLoaderPrivate()
{
for (int i = 0; i < libraryList.count(); ++i) {
QLibraryPrivate *library = libraryList.at(i);
library->unload();
for (QLibraryPrivate *library : qAsConst(libraryList))
library->release();
}
}
void QFactoryLoader::update()