From 08fc2878e77a04138e9208547986c7ce986d1d18 Mon Sep 17 00:00:00 2001 From: h2zero Date: Mon, 18 May 2020 06:47:44 -0600 Subject: [PATCH] NimBLEScan: Corrected ::erase() iteration --- src/NimBLEScan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NimBLEScan.cpp b/src/NimBLEScan.cpp index 84cb62e..74c5910 100644 --- a/src/NimBLEScan.cpp +++ b/src/NimBLEScan.cpp @@ -333,7 +333,7 @@ void NimBLEScan::stop() { void NimBLEScan::erase(const NimBLEAddress &address) { NIMBLE_LOGI(LOG_TAG, "erase device: %s", address.toString().c_str()); - for(auto it = m_scanResults.m_advertisedDevicesVector.begin(); it != m_scanResults.m_advertisedDevicesVector.begin(); ++it) { + for(auto it = m_scanResults.m_advertisedDevicesVector.begin(); it != m_scanResults.m_advertisedDevicesVector.end(); ++it) { if((*it)->getAddress() == address) { delete *it; m_scanResults.m_advertisedDevicesVector.erase(it);