From ab17733e1d52d2f378575e89cab69ded6676aa71 Mon Sep 17 00:00:00 2001 From: Vekhir Date: Wed, 14 Aug 2024 20:48:05 +0200 Subject: [PATCH] fix(UBNetworkAccessManager): Use atomic_int instead of volatile volatile is intended for hardware interaction, where changes might not be obvious from the given code, disabling certain compiler features. The intended use is atomic operations, so use that instead. --- src/network/UBNetworkAccessManager.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/network/UBNetworkAccessManager.h b/src/network/UBNetworkAccessManager.h index 152440674..e89d1507d 100644 --- a/src/network/UBNetworkAccessManager.h +++ b/src/network/UBNetworkAccessManager.h @@ -30,6 +30,7 @@ #ifndef UBNETWORKACCESSMANAGER_H #define UBNETWORKACCESSMANAGER_H +#include #include class UBNetworkAccessManager : public QNetworkAccessManager @@ -50,7 +51,7 @@ class UBNetworkAccessManager : public QNetworkAccessManager static UBNetworkAccessManager *sNetworkAccessManager; - volatile int mProxyAuthenticationCount; + std::atomic_int mProxyAuthenticationCount; private slots: void authenticationRequired(QNetworkReply *reply, QAuthenticator *auth);