mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
fix: stop xray before closing the app
This commit is contained in:
@@ -63,7 +63,12 @@ bool XrayController::stop()
|
|||||||
ProxyLogger::getInstance().info("Stopping Xray via IPC");
|
ProxyLogger::getInstance().info("Stopping Xray via IPC");
|
||||||
|
|
||||||
const bool ipcResult = IpcClient::withInterface([](QSharedPointer<IpcInterfaceReplica> iface) {
|
const bool ipcResult = IpcClient::withInterface([](QSharedPointer<IpcInterfaceReplica> iface) {
|
||||||
iface->xrayStop();
|
auto xrayStop = iface->xrayStop();
|
||||||
|
if (!xrayStop.waitForFinished() || !xrayStop.returnValue()) {
|
||||||
|
ProxyLogger::getInstance().warning("Failed to stop Xray via IPC");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}, []() {
|
}, []() {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user