Merge pull request #2503 from c1728p9/singleton_ptr_fix

Fix SingletonPtr problems
pull/2527/head
Martin Kojtal 2016-08-23 09:27:05 +01:00 committed by GitHub
commit 58897c6613
1 changed files with 3 additions and 1 deletions

View File

@ -76,7 +76,9 @@ struct SingletonPtr {
T* get() {
if (NULL == _ptr) {
singleton_lock();
_ptr = new (_data) T;
if (NULL == _ptr) {
_ptr = new (_data) T();
}
singleton_unlock();
}
// _ptr was not zero initialized or was