Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed by
Diff: SingletonPtr.h
- Revision:
- 125:2e9cc70d1897
- Parent:
- 123:b0220dba8be7
--- a/SingletonPtr.h Fri Aug 19 10:17:11 2016 +0100
+++ b/SingletonPtr.h Wed Aug 31 18:09:46 2016 +0100
@@ -76,7 +76,9 @@
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
