Skip to content

Commit

Permalink
Merge pull request #2503 from c1728p9/singleton_ptr_fix
Browse files Browse the repository at this point in the history
Fix SingletonPtr problems
  • Loading branch information
0xc0170 authored Aug 23, 2016
2 parents 4fd7154 + 707291a commit 58897c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hal/api/SingletonPtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 58897c6

Please sign in to comment.