Qt: Fix corrupted savestate and fatal error text

This commit is contained in:
Vicki Pfau 2021-09-23 22:30:13 -07:00
parent 55a3824671
commit a0dc923042
2 changed files with 6 additions and 2 deletions

View File

@ -13,6 +13,7 @@ Other fixes:
- GBA: Fix out of bounds ROM accesses on patched ROMs smaller than 32 MiB
- Libretro: Fix crash when using Game Boy codes (fixes mgba.io/i/2281)
- Qt: Remove potentially deadlocking optimization
- Qt: Fix corrupted savestate and fatal error text
0.9.2: (2021-07-10)
Emulation fixes:

View File

@ -183,13 +183,16 @@ CoreController::CoreController(mCore* core, QObject* parent)
return;
}
}
message = QString().vsprintf(format, args);
va_list argc;
va_copy(argc, args);
message = QString().vsprintf(format, argc);
va_end(argc);
QMetaObject::invokeMethod(controller, "statusPosted", Q_ARG(const QString&, message));
}
message = QString().vsprintf(format, args);
QMetaObject::invokeMethod(controller, "logPosted", Q_ARG(int, level), Q_ARG(int, category), Q_ARG(const QString&, message));
if (level == mLOG_FATAL) {
QMetaObject::invokeMethod(controller, "crashed", Q_ARG(const QString&, QString().vsprintf(format, args)));
QMetaObject::invokeMethod(controller, "crashed", Q_ARG(const QString&, message));
}
};
}