Skip to content

NimBLEClient::connect, when returning false, does not delete the client object when deleteOnConnectFail=true #336

Open
@dcodeIO

Description

@dcodeIO

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions