Core: Suspend runloop when a core crashes

This commit is contained in:
Vicki Pfau 2021-05-06 00:14:10 -07:00
parent 29115e711b
commit 2a316ee1dc
3 changed files with 4 additions and 2 deletions

View File

@ -12,6 +12,7 @@ Other fixes:
- Qt: Fix applying savetype-only overrides - Qt: Fix applying savetype-only overrides
- Util: Fix loading UPS patches that affect the last byte of the file - Util: Fix loading UPS patches that affect the last byte of the file
Misc: Misc:
- Core: Suspend runloop when a core crashes
- Qt: Rearrange menus some - Qt: Rearrange menus some
- Util: Improve speed of UPS patch loading - Util: Improve speed of UPS patch loading

View File

@ -55,13 +55,13 @@ enum mCoreThreadState {
mTHREAD_INTERRUPTED, mTHREAD_INTERRUPTED,
mTHREAD_PAUSED, mTHREAD_PAUSED,
mTHREAD_MIN_WAITING = mTHREAD_INTERRUPTED, mTHREAD_MIN_WAITING = mTHREAD_INTERRUPTED,
mTHREAD_CRASHED,
mTHREAD_MAX_WAITING = mTHREAD_PAUSED, mTHREAD_MAX_WAITING = mTHREAD_PAUSED,
mTHREAD_INTERRUPTING, mTHREAD_INTERRUPTING,
mTHREAD_EXITING, mTHREAD_EXITING,
mTHREAD_SHUTDOWN, mTHREAD_SHUTDOWN
mTHREAD_CRASHED
}; };
enum mCoreThreadRequest { enum mCoreThreadRequest {

View File

@ -189,6 +189,7 @@ CoreController::CoreController(mCore* core, QObject* parent)
message = QString().vsprintf(format, args); message = QString().vsprintf(format, args);
QMetaObject::invokeMethod(controller, "logPosted", Q_ARG(int, level), Q_ARG(int, category), Q_ARG(const QString&, message)); QMetaObject::invokeMethod(controller, "logPosted", Q_ARG(int, level), Q_ARG(int, category), Q_ARG(const QString&, message));
if (level == mLOG_FATAL) { if (level == mLOG_FATAL) {
mCoreThreadMarkCrashed(controller->thread());
QMetaObject::invokeMethod(controller, "crashed", Q_ARG(const QString&, QString().vsprintf(format, args))); QMetaObject::invokeMethod(controller, "crashed", Q_ARG(const QString&, QString().vsprintf(format, args)));
} }
}; };