summaryrefslogtreecommitdiff
path: root/src/corelib/plugin
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-02-01 11:42:25 +0100
committerOlivier Goffart <olivier.goffart@nokia.com>2011-02-02 16:57:57 +0100
commit5a74d76d9fe9f2a49f5e0d062da590ecc08cf9bb (patch)
treec85ade36f249fd1d9e3c83f01d6d85eca2f231c0 /src/corelib/plugin
parent8c8d76ad7dc0d4fb8c95efb70245854f4f69cfc5 (diff)
downloadqt4-tools-5a74d76d9fe9f2a49f5e0d062da590ecc08cf9bb.tar.gz
Fix leak in QFactoryLoader
We need to release the library in case of errors
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r--src/corelib/plugin/qfactoryloader.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp
index 1be32ad531..c0b947ad19 100644
--- a/src/corelib/plugin/qfactoryloader.cpp
+++ b/src/corelib/plugin/qfactoryloader.cpp
@@ -155,9 +155,11 @@ void QFactoryLoader::update()
continue;
}
QObject *instance = library->instance();
- if (!instance)
+ if (!instance) {
+ library->release();
// ignore plugins that have a valid signature but cannot be loaded.
continue;
+ }
QFactoryInterface *factory = qobject_cast<QFactoryInterface*>(instance);
if (instance && factory && instance->qt_metacast(d->iid))
keys = factory->keys();