diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2011-02-01 10:42:25 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-02-02 15:57:57 (GMT) |
commit | 5a74d76d9fe9f2a49f5e0d062da590ecc08cf9bb (patch) | |
tree | c85ade36f249fd1d9e3c83f01d6d85eca2f231c0 /src | |
parent | 8c8d76ad7dc0d4fb8c95efb70245854f4f69cfc5 (diff) | |
download | Qt-5a74d76d9fe9f2a49f5e0d062da590ecc08cf9bb.zip Qt-5a74d76d9fe9f2a49f5e0d062da590ecc08cf9bb.tar.gz Qt-5a74d76d9fe9f2a49f5e0d062da590ecc08cf9bb.tar.bz2 |
Fix leak in QFactoryLoader
We need to release the library in case of errors
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/plugin/qfactoryloader.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/plugin/qfactoryloader.cpp b/src/corelib/plugin/qfactoryloader.cpp index 1be32ad..c0b947a 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(); |