Skip to content

NimBLEDevice::deinit() Memory Leak #1096

@justcallmekoko

Description

@justcallmekoko

There appears to be a memory leak when deinitializing NimBLEDevice.

The following code demonstrates the memory leak. This is using ESP32-C5 and NimBLE commit b425a1a

Edit: You should see available memory slowly going down until eventual crash.

Edit 2: Passing true to NimBLEDevice::deinit() does not resolve the issue.

#include <NimBLEDevice.h>

void setup() {
  Serial.begin(115200);

  while(!Serial) delay(100);
}

void loop() {
  Serial.println(ESP.getFreeHeap());
  NimBLEDevice::init("");
  delay(100);
  NimBLEDevice::deinit();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions