Skip to content

Commit 2e7c722

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 31aad35 commit 2e7c722

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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 mProxyAuthenticationCount;
5455

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

0 commit comments

Comments
 (0)