From 52fe61b1caac76b2ad558632d6f40462df670e49 Mon Sep 17 00:00:00 2001 From: arm64v8a <48624112+arm64v8a@users.noreply.github.com> Date: Wed, 17 Aug 2022 16:04:43 +0800 Subject: [PATCH] try fix crash --- core_commit.txt | 2 +- matsuri_commit.txt | 2 +- ui/mainwindow.cpp | 6 +++--- ui/mainwindow.h | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core_commit.txt b/core_commit.txt index 59acbec..f919bc0 100644 --- a/core_commit.txt +++ b/core_commit.txt @@ -1 +1 @@ -98f91bf391bc16d6c5c825b406b5bdd82f06870e +1951fa09a89e8e1f19abfbd0d91478a3e5e311a7 diff --git a/matsuri_commit.txt b/matsuri_commit.txt index 8c08cee..35caafe 100644 --- a/matsuri_commit.txt +++ b/matsuri_commit.txt @@ -1 +1 @@ -b827a53549f0c79311bb8ac6e01bedff5a19a91e +9ac86c30c6190a358da2c83b2b6c093df45af919 diff --git a/ui/mainwindow.cpp b/ui/mainwindow.cpp index 414aa2b..33a8cf6 100644 --- a/ui/mainwindow.cpp +++ b/ui/mainwindow.cpp @@ -378,14 +378,14 @@ MainWindow::MainWindow(QWidget *parent) for (int retry = 0; retry < 10; retry++) { showLog("Starting nekoray core " + starting_info + "\n"); - core_process = new QProcess; + auto core_process = new QProcess; core_process_show_stderr = false; connect(core_process, &QProcess::readyReadStandardOutput, this, - [&]() { + [=]() { showLog(core_process->readAllStandardOutput().trimmed()); }); connect(core_process, &QProcess::readyReadStandardError, this, - [&]() { + [=]() { auto log = core_process->readAllStandardError().trimmed(); if (core_process_show_stderr) { showLog(log); diff --git a/ui/mainwindow.h b/ui/mainwindow.h index c75c608..97502f9 100644 --- a/ui/mainwindow.h +++ b/ui/mainwindow.h @@ -120,7 +120,6 @@ private: // bool core_process_killed = false; bool core_process_show_stderr = false; - QProcess *core_process = nullptr; qint64 vpn_pid = 0; QFileSystemWatcher *watcher = nullptr; //