fix: core crashed

This commit is contained in:
arm64v8a
2023-05-19 18:30:43 +09:00
parent ec25e0ed00
commit fc9d853bae
6 changed files with 49 additions and 30 deletions

View File

@@ -44,9 +44,6 @@
#include <QMessageBox>
#include <QDir>
#include <QFileInfo>
#include <QElapsedTimer>
QElapsedTimer coreRestartTimer;
void UI_InitMainWindow() {
mainwindow = new MainWindow;
@@ -579,15 +576,6 @@ void MainWindow::dialog_message_impl(const QString &sender, const QString &info)
} else if (info == "CoreCrashed") {
neko_stop(true);
} else if (info.startsWith("CoreRestarted")) {
if (coreRestartTimer.isValid()) {
if (coreRestartTimer.restart() < 10 * 1000) {
coreRestartTimer = QElapsedTimer();
show_log_impl("[Error] " + tr("Core exits too frequently, stop automatic restart this profile."));
return;
}
} else {
coreRestartTimer.start();
}
neko_start(info.split(",")[1].toInt());
}
}