From a01c30623df13adffcdbe488df4e10369c1b33ea Mon Sep 17 00:00:00 2001 From: Qv2ray Bot <59914293+Qv2ray@users.noreply.github.com> Date: Tue, 21 Jan 2020 09:38:16 +0800 Subject: [PATCH] fix: prevent wait for V2ray core, fixed #265 --- src/components/QvKernelInteractions.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/QvKernelInteractions.cpp b/src/components/QvKernelInteractions.cpp index ba61e759..0739bd07 100644 --- a/src/components/QvKernelInteractions.cpp +++ b/src/components/QvKernelInteractions.cpp @@ -98,12 +98,9 @@ namespace Qv2ray process.setProcessEnvironment(env); DEBUG(MODULE_VCORE, "Starting V2ray core with test options") process.start(conf.v2CorePath, QStringList() << "-test" << "-config" << path, QIODevice::ReadWrite | QIODevice::Text); + process.waitForFinished(); - if (!process.waitForFinished(1000) && process.exitCode() != 0) { - LOG(MODULE_VCORE, "V2ray core failed with an exit code: " + QSTRN(process.exitCode())) - QvMessageBoxWarn(nullptr, tr("Cannot start V2ray"), tr("V2ray core failed with an exit code: ") + QSTRN(process.exitCode())); - return false; - } else if (process.exitCode() != 0) { + if (process.exitCode() != 0) { QString output = QString(process.readAllStandardOutput()); QvMessageBoxWarn(nullptr, tr("Configuration Error"), output.mid(output.indexOf("anti-censorship.") + 17)); return false;