mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Fix static initialisation order fiasco issue for Version variables
Fixes a crash that could occur if the static constructor function for the MainSettings.cpp TU happened to run before the variables in Common/Version.cpp are initialised. (This is known as the static initialisation order fiasco.) By using wrapper functions, those variables are now guaranteed to be constructed on first use.
This commit is contained in:
@ -158,7 +158,7 @@ void NetPlayBrowser::Refresh()
|
||||
std::map<std::string, std::string> filters;
|
||||
|
||||
if (m_check_hide_incompatible->isChecked())
|
||||
filters["version"] = Common::scm_desc_str;
|
||||
filters["version"] = Common::GetScmDescStr();
|
||||
|
||||
if (!m_edit_name->text().isEmpty())
|
||||
filters["name"] = m_edit_name->text().toStdString();
|
||||
@ -246,7 +246,7 @@ void NetPlayBrowser::UpdateList()
|
||||
auto* player_count = new QTableWidgetItem(QStringLiteral("%1").arg(entry.player_count));
|
||||
auto* version = new QTableWidgetItem(QString::fromStdString(entry.version));
|
||||
|
||||
const bool enabled = Common::scm_desc_str == entry.version;
|
||||
const bool enabled = Common::GetScmDescStr() == entry.version;
|
||||
|
||||
for (const auto& item : {region, name, password, in_game, game_id, player_count, version})
|
||||
item->setFlags(enabled ? Qt::ItemIsEnabled | Qt::ItemIsSelectable : Qt::NoItemFlags);
|
||||
|
Reference in New Issue
Block a user