Avoid crash when refreshing style sheet. For some reasons it helps to set and empty stylesheet upfront

This commit is contained in:
Klaus Basan
2018-08-08 20:39:38 +02:00
parent 07a44dfc08
commit ac128eb786
2 changed files with 6 additions and 3 deletions

View File

@@ -78,13 +78,14 @@ CSwiftCore::~CSwiftCore()
void CSwiftCore::initStyleSheet()
{
if (!sGui || sGui->isShuttingDown()) { return; }
const QString s = sGui->getStyleSheetUtility().styles(
{
CStyleSheetUtility::fileNameFonts(),
CStyleSheetUtility::fileNameStandardWidget(),
CStyleSheetUtility::fileNameSwiftCore()
}
);
});
this->setStyleSheet(""); // avoid crash, need to reset before
this->setStyleSheet(s);
}
@@ -104,7 +105,7 @@ void CSwiftCore::showSettingsDialog()
void CSwiftCore::showRawFsdMessageDialog()
{
if(!m_rawFsdMessageDialog)
if (!m_rawFsdMessageDialog)
{
m_rawFsdMessageDialog.reset(new CRawFsdMessagesDialog(this));
}