From b35b54f2c204ac59f67dbcc722d0c1c64f07dbe9 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 16 Jun 2025 15:11:42 +0200 Subject: [PATCH] ble pool --- esphome/components/esp32_ble/ble.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/esphome/components/esp32_ble/ble.cpp b/esphome/components/esp32_ble/ble.cpp index 1f075b1718..8b39732156 100644 --- a/esphome/components/esp32_ble/ble.cpp +++ b/esphome/components/esp32_ble/ble.cpp @@ -388,17 +388,10 @@ void load_ble_event(BLEEvent *event, esp_gatts_cb_event_t e, esp_gatt_if_t i, es } template void enqueue_ble_event(Args... args) { - // Check if queue is full before allocating - if (global_ble->ble_events_.full()) { - // Queue is full, drop the event - global_ble->ble_events_.increment_dropped_count(); - return; - } - // Allocate an event from the pool BLEEvent *event = global_ble->ble_event_pool_.allocate(); if (event == nullptr) { - // Pool is full, drop the event + // No events available - queue is full or we're out of memory global_ble->ble_events_.increment_dropped_count(); return; }