Fix crash when using QCoreApplication::applicationName in a global static
e.g. when a global-static configuration object uses QTemporaryFile for saving to disk (via QSaveFile). Change-Id: I532aec6de7411e10e4461d5a4ac60686e2f482df Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
98dbaecf7f
commit
e0cf8cf5f1
@ -1977,7 +1977,7 @@ void QCoreApplication::setApplicationName(const QString &application)
|
||||
|
||||
QString QCoreApplication::applicationName()
|
||||
{
|
||||
QString appname = coreappdata()->application;
|
||||
QString appname = coreappdata() ? coreappdata()->application : QString();
|
||||
if (appname.isEmpty() && QCoreApplication::self)
|
||||
appname = QCoreApplication::self->d_func()->appName();
|
||||
return appname;
|
||||
|
Loading…
Reference in New Issue
Block a user