summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-06-30 10:31:32 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-07-01 19:08:24 +0200
commit5a5c20ad402af18f7bf56ad11edee2dfec3d7e63 (patch)
tree4998a57e1e7374f10b4bd58468ad2266398e9331 /src/corelib/plugin
parent062318feb2d3b7598409c7e81e4459c2f4607764 (diff)
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>
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r--src/corelib/plugin/qfactoryloader.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index 8b87baaff9..edadf7180a 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -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()