proof all dialogs against use-after-free when closing main window while a dialog is open

This commit is contained in:
Arisotura
2024-10-27 14:24:59 +01:00
parent a61754bb58
commit f2dce621ce
11 changed files with 90 additions and 0 deletions

View File

@ -59,6 +59,13 @@ MPSettingsDialog::~MPSettingsDialog()
void MPSettingsDialog::done(int r)
{
if (!((MainWindow*)parent())->getEmuInstance())
{
QDialog::done(r);
closeDlg();
return;
}
if (r == QDialog::Accepted)
{
auto& cfg = emuInstance->getGlobalConfig();