the ble goo is still leaking on destroy, but better

This commit is contained in:
geeksville
2020-02-23 14:09:52 -08:00
parent a45d7be922
commit 8dfd7a4a71
2 changed files with 9 additions and 3 deletions

View File

@@ -314,7 +314,13 @@ BLEService *createMeshBluetoothService(BLEServer *server)
meshFromNumCharacteristic->addDescriptor(new (btPool) BLE2902()); // Needed so clients can request notification
service->start();
server->getAdvertising()->addServiceUUID(service->getUUID());
// We only add to advertisting once, because the ESP32 arduino code is dumb and that object never dies
static bool firstTime = true;
if(firstTime) {
firstTime = false;
server->getAdvertising()->addServiceUUID(service->getUUID());
}
DEBUG_MSG("*** Mesh service:\n");
service->dump();