We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d594148 commit 35ce016Copy full SHA for 35ce016
cpp/idletimer.cpp
@@ -12,8 +12,10 @@ class IdleTimer : public QObject
12
public:
13
14
static IdleTimer *singleton() {
15
- static IdleTimer singleton;
16
- return &singleton;
+ //static IdleTimer singleton;
+ if (_singleton == nullptr)
17
+ _singleton = new IdleTimer;
18
+ return _singleton;
19
}
20
21
void init(int32_t *guiIdleRun)
@@ -38,13 +40,17 @@ class IdleTimer : public QObject
38
40
39
41
42
43
+ static IdleTimer* _singleton;
44
+
45
private:
46
47
int32_t *guiIdleRun;
48
49
QBasicTimer timer;
50
};
51
52
+IdleTimer* IdleTimer::_singleton;
53
54
void idleTimerInit(int32_t *guiIdleRun)
55
{
56
IdleTimer::singleton()->init(guiIdleRun);
0 commit comments