diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2011-09-26 07:46:53 (GMT) |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2011-09-26 08:01:13 (GMT) |
commit | 8d9e63130767858287331d7e19d732919d620607 (patch) | |
tree | 9c6c2111e254d328a8d5c4535caa5562c48e4d68 /src/corelib/plugin | |
parent | 930461946ce14051e56a3d7f49e2cd24742b8777 (diff) | |
download | Qt-8d9e63130767858287331d7e19d732919d620607.zip Qt-8d9e63130767858287331d7e19d732919d620607.tar.gz Qt-8d9e63130767858287331d7e19d732919d620607.tar.bz2 |
Fix plugin implicit loading when calling QPluginLoader::instance().
QPluginLoader::instance() didn't increase loading refcount if another
QPluginLoader had already loaded the plugin. This meant that if the
another QPluginLoader subsequently unloaded the plugin, the instance
would be destroyed even if the second loader still wanted to use it.
Also improved the tst_QPluginLoader::deleteinstanceOnUnload() test case
to test more combinations of deletion order and explicit/implicit
loading.
Task-number: QT-5259
Reviewed-by: Sami Merila
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r-- | src/corelib/plugin/qpluginloader.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp index bbb64e4..9f9ea1a 100644 --- a/src/corelib/plugin/qpluginloader.cpp +++ b/src/corelib/plugin/qpluginloader.cpp @@ -198,7 +198,7 @@ QPluginLoader::~QPluginLoader() */ QObject *QPluginLoader::instance() { - if (!isLoaded() && !load()) + if (!load()) return 0; if (!d->inst && d->instance) d->inst = d->instance(); |