diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index b863479..9137be5 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -2500,15 +2500,10 @@ void MainWindow::HotkeyEvent(const QString &key) { } bool MainWindow::StopVPNProcess() { - QMutex waitStop; - waitStop.lock(); - runOnThread([=, this, &waitStop] + runOnThread([=, this] { core_process->Kill(); - waitStop.unlock(); - }, DS_cores); - waitStop.lock(); - waitStop.unlock(); + }, DS_cores, true); return true; } diff --git a/src/ui/mainwindow_rpc.cpp b/src/ui/mainwindow_rpc.cpp index 90b24fe..c69b7f1 100644 --- a/src/ui/mainwindow_rpc.cpp +++ b/src/ui/mainwindow_rpc.cpp @@ -512,7 +512,7 @@ void MainWindow::profile_start(int _id) { int r = msg.exec() - 2; if (r == 0) { - GetMainWindow()->StopVPNProcess(); + StopVPNProcess(); } }); return false;