Skip to content

Commit 802beaa

Browse files
thiagomacieiraQt Cherry-pick Bot
authored and
Qt Cherry-pick Bot
committed
QResource: try to survive being created during application shut down
Similar to commit 12d4bf1, 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 Change-Id: I7b653afb1b41ef3c1c9afffdaa93e6558740016b Reviewed-by: Marc Mutz <[email protected]> Reviewed-by: Edward Welbourne <[email protected]> (cherry picked from commit ba18ae3) Reviewed-by: Qt Cherry-pick Bot <[email protected]> (cherry picked from commit c6fdf95)
1 parent 6144663 commit 802beaa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/corelib/io/qresource.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ void QResourcePrivate::ensureInitialized() const
371371
{
372372
if (!related.isEmpty())
373373
return;
374+
if (resourceGlobalData.isDestroyed())
375+
return;
374376
QResourcePrivate *that = const_cast<QResourcePrivate *>(this);
375377
if (fileName == ":"_L1)
376378
that->fileName += u'/';

0 commit comments

Comments
 (0)