Skip to content

Commit 42b1e55

Browse files
committed
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.
1 parent e9abc43 commit 42b1e55

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/network/UBNetworkAccessManager.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#ifndef UBNETWORKACCESSMANAGER_H
3131
#define UBNETWORKACCESSMANAGER_H
3232

33+
#include <atomic>
3334
#include <QtNetwork>
3435

3536
class UBNetworkAccessManager : public QNetworkAccessManager
@@ -50,7 +51,7 @@ class UBNetworkAccessManager : public QNetworkAccessManager
5051

5152
static UBNetworkAccessManager *sNetworkAccessManager;
5253

53-
volatile int mProxyAuthenticationCount;
54+
std::atomic_int int mProxyAuthenticationCount;
5455

5556
private slots:
5657
void authenticationRequired(QNetworkReply *reply, QAuthenticator *auth);

0 commit comments

Comments
 (0)