From f5a8e95dfacd269ef318b56fce4cae6cf8e59538 Mon Sep 17 00:00:00 2001 From: Nova Date: Sat, 29 Nov 2025 02:21:54 +0330 Subject: [PATCH] Fix reset core hanging --- src/ui/mainwindow.cpp | 9 ++------- src/ui/mainwindow_rpc.cpp | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) 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;