From 0024b78a396b696a6ecc72285c60a1f771f04d92 Mon Sep 17 00:00:00 2001 From: Andres Amaya Garcia Date: Wed, 16 Dec 2015 16:43:04 +0000 Subject: [PATCH] Clear shutdown callchain after exec callbacks --- ble/Gap.h | 1 + ble/GattClient.h | 1 + ble/GattServer.h | 1 + ble/SecurityManager.h | 1 + 4 files changed, 4 insertions(+) diff --git a/ble/Gap.h b/ble/Gap.h index f94880e..5b4067a 100644 --- a/ble/Gap.h +++ b/ble/Gap.h @@ -1047,6 +1047,7 @@ public: virtual ble_error_t reset(void) { /* Notify that the instance is about to shutdown */ shutdownCallChain.call(this); + shutdownCallChain.clear(); /* Clear Gap state */ state.advertising = 0; diff --git a/ble/GattClient.h b/ble/GattClient.h index d523e0c..c65207f 100644 --- a/ble/GattClient.h +++ b/ble/GattClient.h @@ -376,6 +376,7 @@ public: virtual ble_error_t reset(void) { /* Notify that the instance is about to shutdown */ shutdownCallChain.call(this); + shutdownCallChain.clear(); onDataReadCallbackChain.clear(); onDataWriteCallbackChain.clear(); diff --git a/ble/GattServer.h b/ble/GattServer.h index 3f89bc8..ea46a88 100644 --- a/ble/GattServer.h +++ b/ble/GattServer.h @@ -447,6 +447,7 @@ public: virtual ble_error_t reset(void) { /* Notify that the instance is about to shutdown */ shutdownCallChain.call(this); + shutdownCallChain.clear(); serviceCount = 0; characteristicCount = 0; diff --git a/ble/SecurityManager.h b/ble/SecurityManager.h index e9996c5..e508954 100644 --- a/ble/SecurityManager.h +++ b/ble/SecurityManager.h @@ -284,6 +284,7 @@ public: virtual ble_error_t reset(void) { /* Notify that the instance is about to shutdown */ shutdownCallChain.call(this); + shutdownCallChain.clear(); securitySetupInitiatedCallback = NULL; securitySetupCompletedCallback = NULL;