From b0140e27c9016c3da89d81c8b9cca6cd6251eb76 Mon Sep 17 00:00:00 2001 From: Nova Date: Wed, 23 Jul 2025 09:09:17 +0330 Subject: [PATCH] fix some shutdown issues --- src/ui/mainwindow.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index d216cf4..30f4bf0 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -797,9 +797,6 @@ void MainWindow::on_menu_hotkey_settings_triggered() { } void MainWindow::on_commitDataRequest() { - qDebug() << "Handling DNS setting"; - if (Configs::dataStore->system_dns_set) set_system_dns(false, false); - qDebug() << "Done handling DNS setting"; qDebug() << "Start of data save"; // if (!isMaximized()) { @@ -816,6 +813,7 @@ void MainWindow::on_commitDataRequest() { if (Configs::dataStore->remember_enable && last_id >= 0) { Configs::dataStore->remember_id = last_id; } + if (running) running->Save(); // Configs::dataStore->Save(); Configs::profileManager->SaveManager(); @@ -836,13 +834,18 @@ void MainWindow::prepare_exit() tray->hide(); Configs::dataStore->prepare_exit = true; // - set_spmode_system_proxy(false, false); RegisterHotkey(true); + if (Configs::dataStore->system_dns_set) set_system_dns(false, false); + set_spmode_system_proxy(false, false); // on_commitDataRequest(); // - if (running) running->Save(); Configs::dataStore->save_control_no_save = true; // don't change datastore after this line + if (Configs::dataStore->spmode_vpn) + { + profile_stop(false, true); + sem_stopped.acquire(); + } API::defaultClient->Exit(); mu_exit.unlock(); qDebug() << "prepare exit done!";