Skip to content

Commit

Permalink
fix(UBNetworkAccessManager): Use atomic_int instead of volatile
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Vekhir committed Aug 14, 2024
1 parent e9abc43 commit 42b1e55
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/network/UBNetworkAccessManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#ifndef UBNETWORKACCESSMANAGER_H
#define UBNETWORKACCESSMANAGER_H

#include <atomic>
#include <QtNetwork>

class UBNetworkAccessManager : public QNetworkAccessManager
Expand All @@ -50,7 +51,7 @@ class UBNetworkAccessManager : public QNetworkAccessManager

static UBNetworkAccessManager *sNetworkAccessManager;

volatile int mProxyAuthenticationCount;
std::atomic_int int mProxyAuthenticationCount;

private slots:
void authenticationRequired(QNetworkReply *reply, QAuthenticator *auth);
Expand Down

0 comments on commit 42b1e55

Please sign in to comment.