Skip to content

Commit 910b7a6

Browse files
clear the pal gap queue on reset
1 parent 30cd607 commit 910b7a6

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

connectivity/FEATURE_BLE/source/generic/GapImpl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,7 @@ ble_error_t Gap::reset()
12141214
/* Notify that the instance is about to shut down */
12151215
// shutdownCallChain.call(this);
12161216
shutdownCallChain.clear();
1217+
_event_queue.clear();
12171218

12181219
_event_handler = nullptr;
12191220
_initiating = false;

connectivity/FEATURE_BLE/source/pal/PalEventQueue.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ class PalEventQueue {
5252
* BLEInstanceBase::process
5353
*/
5454
virtual bool post(const mbed::Callback<void()>& event) = 0;
55+
56+
/** Remove all pending events.
57+
*/
58+
virtual void clear() = 0;
5559
};
5660

5761
} // namespace ble

0 commit comments

Comments
 (0)