forked from qt-creator/qt-creator
Core: Fix use after free ASAN error
When closing the "Preferences..." dialog with Esc key, the ASAN address checker would report a use after free at "while (m_running)" below in the code. Fixes: QTCREATORBUG-31047 Change-Id: I484a80305ebbd903607e945eb56b331f57d40370 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -790,7 +790,7 @@ bool SettingsDialog::execDialog()
|
|||||||
ICore::settings()->setValueWithDefault(kPreferenceDialogSize, size(), initialSize);
|
ICore::settings()->setValueWithDefault(kPreferenceDialogSize, size(), initialSize);
|
||||||
// make sure that the current "single" instance is deleted
|
// make sure that the current "single" instance is deleted
|
||||||
// we can't delete right away, since we still access the m_applied member
|
// we can't delete right away, since we still access the m_applied member
|
||||||
deleteLater();
|
QMetaObject::invokeMethod(this, [this] { deleteLater(); }, Qt::QueuedConnection);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user