QResource: try to survive being created during application shut down
Similar to commit 12d4bf1ab52748cb84894f50d437064b439e0b7d, which was for QLocale. Like it, QResource can be used very late in the execution, like for example the logging system. For example (simplified): #9 0x00007ffff759d497 in resourceMutex () at /io/qresource.cpp:188 #10 0x00007ffff759d615 in QResourcePrivate::load (this=0x41c940, file=...) at /io/qresource.cpp:333 #11 0x00007ffff759dc19 in QResourcePrivate::ensureInitialized (this=0x41c940) at /io/qresource.cpp:386 #14 0x00007ffff75011a9 in QLibrarySettings::load() at /global/qlibraryinfo.cpp:80 #22 0x00007ffff7501756 in havePaths () at /global/qlibraryinfo.cpp:149 #23 0x00007ffff75028e3 in QLibraryInfoPrivate::paths (p=QLibraryInfo::DataPath, usageMode=QLibraryInfoPrivate::RegularUsage) at /global/qlibraryinfo.cpp:613 #26 0x00007ffff758e4f0 in QLoggingRegistry::initializeRules () at /io/qloggingregistry.cpp:309 #34 0x00007ffff758f007 in QLoggingRegistry::instance () at io/qloggingregistry.cpp:424 #35 0x00007ffff758c50b in QLoggingCategory::init () at io/qloggingcategory.cpp:188 #43 0x00007ffff758c6bb in QLoggingCategory::defaultCategory () at io/qloggingcategory.cpp:317 #44 0x00007ffff750ff8e in qt_message_print (msgType=QtWarningMsg, context=..., message=...) at global/qlogging.cpp:2036 #45 0x00007ffff7509515 in qt_message(msgType=QtWarningMsg, context=..., msg=...) at global/qlogging.cpp:360 #46 0x00007ffff750a712 in QMessageLogger::warning (this=0x7fffffffd8b0, msg=...) at global/qlogging.cpp:600 #47 0x00007ffff790e083 in QThreadStorageData::finish (p=0x41b588) at thread/qthreadstorage.cpp:160 #50 0x00007ffff78ed423 in QThreadPrivate::finish (this=0x41b5e0) at thread/qthread_unix.cpp:404 #51 0x00007ffff78ec8ed in destroy_current_thread_data (p=0x41b520) at thread/qthread_unix.cpp:154 #52 0x00007ffff78ec9ec in Cleanup::~Cleanup () at thread/qthread_unix.cpp:204 Task-number: QTBUG-133206 Task-number: QTBUG-133500 Pick-to: 6.9 6.8 Change-Id: I7b653afb1b41ef3c1c9afffdaa93e6558740016b Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
8ff4d0bc18
commit
ba18ae3869
@ -371,6 +371,8 @@ void QResourcePrivate::ensureInitialized() const
|
||||
{
|
||||
if (!related.isEmpty())
|
||||
return;
|
||||
if (resourceGlobalData.isDestroyed())
|
||||
return;
|
||||
QResourcePrivate *that = const_cast<QResourcePrivate *>(this);
|
||||
if (fileName == ":"_L1)
|
||||
that->fileName += u'/';
|
||||
|
Loading…
x
Reference in New Issue
Block a user