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

@@ -230,6 +230,15 @@ void MainWindow::neko_start(int _id) {
}
auto neko_start_stage2 = [=] {
if (!NekoRay::dataStore->core_running) {
runOnUiThread(
[=] {
core_process->Restart();
},
DS_cores);
QThread::sleep(1);
}
#ifndef NKR_NO_GRPC
libcore::LoadConfigReq req;
req.set_core_config(QJsonObject2QString(result->coreConfig, true).toStdString());
@@ -244,6 +253,8 @@ void MainWindow::neko_start(int _id) {
if (rpcOK && !error.isEmpty()) {
runOnUiThread([=] { MessageBoxWarning("LoadConfig return error", error); });
return false;
} else if (!rpcOK) {
return false;
}
//
NekoRay::traffic::trafficLooper->proxy = result->outboundStat.get();
@@ -338,6 +349,8 @@ void MainWindow::neko_stop(bool crash, bool sem) {
if (rpcOK && !error.isEmpty()) {
runOnUiThread([=] { MessageBoxWarning("Stop return error", error); });
return false;
} else if (!rpcOK) {
return false;
}
}
#endif