diff options
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r-- | src/corelib/plugin/qlibrary.cpp | 9 | ||||
-rw-r--r-- | src/corelib/plugin/qlibrary_p.h | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 1e17c9fbd4..3432f9619d 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -711,7 +711,7 @@ void QLibraryPrivate::updatePluginState() hTempModule = ::LoadLibraryEx((wchar_t*)QDir::toNativeSeparators(fileName).utf16(), 0, dwFlags); SetErrorMode(oldmode); #else - temporary_load = load_sys(); + temporary_load = load(); #endif } QtPluginQueryVerificationDataFunction getMetaData = NULL; @@ -736,11 +736,10 @@ void QLibraryPrivate::updatePluginState() if (getMetaData) ret = qt_get_metadata(getMetaData, this, &exceptionThrown); + if (temporary_load) + unload(); if (!exceptionThrown) { - if (!ret) { - if (temporary_load) - unload_sys(); - } else { + if (ret) { success = true; } retryLoadLibrary = false; diff --git a/src/corelib/plugin/qlibrary_p.h b/src/corelib/plugin/qlibrary_p.h index b425e0d590..abf11be9f7 100644 --- a/src/corelib/plugin/qlibrary_p.h +++ b/src/corelib/plugin/qlibrary_p.h @@ -127,7 +127,9 @@ private: bool unload_sys(); QFunctionPointer resolve_sys(const char *); + /// counts how many QLibrary or QPluginLoader are attached to us, plus 1 if it's loaded QAtomicInt libraryRefCount; + /// counts how many times load() or loadPlugin() were called QAtomicInt libraryUnloadCount; enum { IsAPlugin, IsNotAPlugin, MightBeAPlugin } pluginState; |