mirror of
https://github.com/esphome/esphome.git
synced 2026-08-24 07:06:20 +00:00
Tear down a handle stamped mid-escalation and pin the wrap flags literally
This commit is contained in:
@@ -653,6 +653,12 @@ void RP2GattClient::fail_connection_(uint8_t reason) {
|
||||
if (connect_owner == this) {
|
||||
connect_owner = nullptr;
|
||||
}
|
||||
if (this->state_ == EngineState::CONNECTING && this->con_handle_ != HCI_CON_HANDLE_INVALID) {
|
||||
// A success completion stamped the handle between the escalation
|
||||
// decision and this lock: tear the link down before cleanup wipes the
|
||||
// handle, or it leaks its pool block for the rest of the boot.
|
||||
gap_disconnect(this->con_handle_);
|
||||
}
|
||||
}
|
||||
this->cleanup_link_state_();
|
||||
this->release_scan_inhibit_();
|
||||
|
||||
@@ -7,13 +7,17 @@ from __future__ import annotations
|
||||
from collections.abc import Callable
|
||||
from pathlib import Path
|
||||
|
||||
from esphome.components import rp2040_ble
|
||||
from esphome.core import CORE
|
||||
|
||||
from ..helpers import get_define_value
|
||||
|
||||
WRAP_FLAGS = tuple(
|
||||
f"-Wl,--wrap={symbol}" for symbol in rp2040_ble._BTSTACK_POOL_SYMBOLS
|
||||
# Spelled out rather than derived from rp2040_ble's symbol tuple, so a typo
|
||||
# in the component's list fails here instead of mirroring into the test.
|
||||
WRAP_FLAGS = (
|
||||
"-Wl,--wrap=btstack_memory_gatt_client_get",
|
||||
"-Wl,--wrap=btstack_memory_gatt_client_free",
|
||||
"-Wl,--wrap=btstack_memory_hci_connection_get",
|
||||
"-Wl,--wrap=btstack_memory_hci_connection_free",
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user