Skip to content

Commit 6902b46

Browse files
committed
accept the singleton pattern
C++11 guarantees thread-safe initialization
1 parent ffa0c55 commit 6902b46

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

src/Controller.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class Controller : public QObject {
2626

2727
public:
2828
static Controller& getInstance() {
29+
// cppcheck-suppress threadsafety-threadsafety
2930
static Controller instance;
3031
return instance;
3132
}

src/FileManager.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class FileManager : public QObject {
2828

2929
public:
3030
static FileManager& getInstance() {
31+
// cppcheck-suppress threadsafety-threadsafety
3132
static FileManager instance;
3233
return instance;
3334
}

src/Model.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class Model : public QObject {
5151

5252
public:
5353
static Model& getInstance() {
54+
// cppcheck-suppress threadsafety-threadsafety
5455
static Model instance;
5556
return instance;
5657
}

src/Network.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class Downloader : public QObject {
2727

2828
public:
2929
static Downloader& getInstance() {
30+
// cppcheck-suppress threadsafety-threadsafety
3031
static Downloader instance;
3132
return instance;
3233
}

0 commit comments

Comments
 (0)