When, like in tst_QFactoryLoader::extraSearchPath(), where asan caught it, or, presumably, on re-creation of a QGuiApplication with a different QT_QPA_PLATFORM_PLUGIN_PATH, setExtraSearchPath() is called with a different path than before, then it would leak QLibaryPrivate objects in the call to libraryList.clear(). Fix by adding QLibraryPrivate::Deleter and holding the objects in unique_ptr<QLibraryPrivate, Deleter> instead of as raw pointers. This statically guarantees we're not leaking these objects anywhere else in QFactoryLoader. Change the name of the container from libraryList to libraries to catch any unported users, incl. in older branches. Since libraryList is now a std::vector (QList cannot hold move-only types), statically assert that it was never attempted to be copied or moved, even in older branches, with Q_DISABLE_COPY_MOVE(). Amends ddba24535fb5732c3cb757414cf1a393bd98f693. Not picking to 6.4 and 6.3, as they are closed at this point. Fixes: QTBUG-115286 Change-Id: I6d1272622b12c505975cc72f9aba0d126d2817e2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit e60aed5ed000b635d8424f9120249725d9e68c78) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%