From f9e8dbfcc0cc94ca70989b275e67ce39739cfc4c Mon Sep 17 00:00:00 2001 From: Vivek Kushwaha Date: Thu, 18 Jun 2026 18:35:28 +0530 Subject: [PATCH] Fix profile persistence race during asynchronous mod profile switching Signed-off-by: Vivek Kushwaha --- launcher/ui/pages/instance/ModFolderPage.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/launcher/ui/pages/instance/ModFolderPage.cpp b/launcher/ui/pages/instance/ModFolderPage.cpp index 9ff5e0cd4..a7e8f659e 100644 --- a/launcher/ui/pages/instance/ModFolderPage.cpp +++ b/launcher/ui/pages/instance/ModFolderPage.cpp @@ -286,6 +286,10 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, ModFolderModel* model, QWidget* << "[SAVE_TRIGGER]\n" << "source = updateFinished\n" << "currentProfile = " << m_currentProfile; + if (m_profileLoading) { + m_profileLoading = false; + return; + } saveCurrentProfileState(); }); connect(m_model, &QAbstractItemModel::dataChanged, this, [this]() { @@ -837,10 +841,9 @@ void ModFolderPage::onProfileTabChanged(int index) { m_currentProfile = QString(); setActiveProfileForModel(m_model, QStringLiteral("None")); m_profileTabBar->setProperty("currentProfileName", QString()); + m_profileLoading = false; } - m_profileLoading = false; - qDebug() << "[INSTRUMENTATION]" << ++g_logSequence << "onProfileTabChanged() END" << "index:" << index << "thread:" << QThread::currentThreadId()