Mercurial > hg > svcore
comparison base/Debug.cpp @ 1882:38be2fa29efd
We need to be c++11 compatible here, and make_unique isn't in it
author | Chris Cannam |
---|---|
date | Fri, 26 Jun 2020 12:13:13 +0100 |
parents | 166d7a4c2cd6 |
children |
comparison
equal
deleted
inserted
replaced
1881:b504df98c3be | 1882:38be2fa29efd |
---|---|
30 static QMutex mutex; | 30 static QMutex mutex; |
31 | 31 |
32 SVDebug &getSVDebug() { | 32 SVDebug &getSVDebug() { |
33 mutex.lock(); | 33 mutex.lock(); |
34 if (!svdebug) { | 34 if (!svdebug) { |
35 svdebug = std::make_unique<SVDebug>(); | 35 svdebug = std::unique_ptr<SVDebug>(new SVDebug()); |
36 } | 36 } |
37 mutex.unlock(); | 37 mutex.unlock(); |
38 return *svdebug; | 38 return *svdebug; |
39 } | 39 } |
40 | 40 |
41 SVCerr &getSVCerr() { | 41 SVCerr &getSVCerr() { |
42 mutex.lock(); | 42 mutex.lock(); |
43 if (!svcerr) { | 43 if (!svcerr) { |
44 if (!svdebug) { | 44 if (!svdebug) { |
45 svdebug = std::make_unique<SVDebug>(); | 45 svdebug = std::unique_ptr<SVDebug>(new SVDebug()); |
46 } | 46 } |
47 svcerr = std::make_unique<SVCerr>(*svdebug); | 47 svcerr = std::unique_ptr<SVCerr>(new SVCerr(*svdebug)); |
48 } | 48 } |
49 mutex.unlock(); | 49 mutex.unlock(); |
50 return *svcerr; | 50 return *svcerr; |
51 } | 51 } |
52 | 52 |