esp-nimble-cpp
esp-nimble-cpp copied to clipboard
NimBLEClient::connect, when returning false, does not delete the client object when deleteOnConnectFail=true
During debugging, I somewhat randomly discovered that
pClient->setSelfDelete(true, true);
if (!pClient->connect(false, true, true)) {
NimBLEDevice::deleteClient(pClient); // still needs to be called manually
}
when I was getting a number of clients exceeded log despite enabling self delete. Is this behaving correctly? In my case, technically, connect returns early, skipping the connection attempt, but semantically this wasn't obvious to me.