smart ball test board code

Dependencies:   nrf51-sdk

Fork of nRF51822 by Nordic Semiconductor

Revision:
457:da0323feba9b
Parent:
456:e33de7c4574c
Child:
543:1bf9c597f44f
--- a/source/nRF5xGattClient.cpp	Mon Nov 02 09:05:10 2015 +0000
+++ b/source/nRF5xGattClient.cpp	Mon Nov 02 09:05:10 2015 +0000
@@ -18,8 +18,11 @@
 
 nRF5xGattClient &
 nRF5xGattClient::getInstance(void) {
-    static nRF5xGattClient nRFGattClientSingleton;
-    return nRFGattClientSingleton;
+    static nRF5xGattClient* nRFGattClientSingleton = NULL;
+    if (nRFGattClientSingleton == NULL) {
+        nRFGattClientSingleton = new nRF5xGattClient();
+    }
+    return *nRFGattClientSingleton;
 }
 
 #if !defined(TARGET_MCU_NRF51_16K_S110) && !defined(TARGET_MCU_NRF51_32K_S110)