No changes

Fork of nRF51822 by Nordic Semiconductor

Revision:
563:9c4b96f7be8d
Parent:
561:613dbbdeed27
Child:
565:cf03471a4ec4
--- a/source/nRF5xGattServer.cpp	Mon Jan 11 10:19:15 2016 +0000
+++ b/source/nRF5xGattServer.cpp	Mon Jan 11 10:19:16 2016 +0000
@@ -23,10 +23,8 @@
 #include "nRF5xGap.h"
 
 nRF5xGattServer &nRF5xGattServer::getInstance(void) {
-    if (gattServerInstance == NULL) {
-        gattServerInstance = new nRF5xGattServer();
-    }
-    return (nRF5xGattServer &) *gattServerInstance;
+    static nRF5xGattServer m_instance;
+    return m_instance;
 }
 
 /**************************************************************************/
@@ -314,33 +312,6 @@
 
 /**************************************************************************/
 /*!
-    @brief  Clear nRF5xGattServer's state.
-
-    @returns    ble_error_t
-
-    @retval     BLE_ERROR_NONE
-                Everything executed properly
-*/
-/**************************************************************************/
-ble_error_t nRF5xGattServer::cleanup(void)
-{
-    /* Clear all state that is from the parent, including private members */
-    if (GattServer::cleanup() != BLE_ERROR_NONE) {
-        return BLE_ERROR_INVALID_STATE;
-    }
-
-    /* Clear derived class members */
-    memset(p_characteristics,        0, sizeof(p_characteristics));
-    memset(p_descriptors,            0, sizeof(p_descriptors));
-    memset(nrfCharacteristicHandles, 0, sizeof(ble_gatts_char_handles_t));
-    memset(nrfDescriptorHandles,     0, sizeof(nrfDescriptorHandles));
-    descriptorCount = 0;
-
-    return BLE_ERROR_NONE;
-}
-
-/**************************************************************************/
-/*!
     @brief  Callback handler for events getting pushed up from the SD
 */
 /**************************************************************************/