1

Fork of nRF51822 by Nordic Semiconductor

Files at this revision

API Documentation at this revision

Comitter:
rgrover1
Date:
Tue Aug 11 15:14:22 2015 +0100
Parent:
413:574523656728
Child:
415:92bda1851be2
Commit message:
Synchronized with git rev e699db6a
Author: Rohit Grover
nRFGattClient: move the allocation of the singleton to within the getInstance() method.
This saves memory when getInstance() isn't used.

Changed in this revision

source/nRF5xGattClient.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/source/nRF5xGattClient.cpp	Mon Aug 10 15:18:44 2015 +0100
+++ b/source/nRF5xGattClient.cpp	Tue Aug 11 15:14:22 2015 +0100
@@ -16,10 +16,9 @@
 
 #include "nRF5xGattClient.h"
 
-nRF5xGattClient nRFGattClientSingleton;
-
 nRF5xGattClient &
 nRF5xGattClient::getInstance(void) {
+    static nRF5xGattClient nRFGattClientSingleton;
     return nRFGattClientSingleton;
 }