Fix delete was not really deleting in tinytest
This commit is contained in:
@@ -399,11 +399,11 @@ void loop()
|
|||||||
}
|
}
|
||||||
if (client)
|
if (client)
|
||||||
{
|
{
|
||||||
clients.erase(s);
|
|
||||||
for (auto it: clients)
|
for (auto it: clients)
|
||||||
{
|
{
|
||||||
if (it.second != client) continue;
|
if (it.second != client) continue;
|
||||||
Serial << "deleted" << endl;
|
Serial << "deleted" << endl;
|
||||||
|
delete (it.second);
|
||||||
clients.erase(it.first);
|
clients.erase(it.first);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -413,9 +413,9 @@ void loop()
|
|||||||
{
|
{
|
||||||
for(auto it: brokers)
|
for(auto it: brokers)
|
||||||
{
|
{
|
||||||
Serial << (int32_t)it.second << '/' << (int32_t)broker << endl;
|
|
||||||
if (broker != it.second) continue;
|
if (broker != it.second) continue;
|
||||||
Serial << "deleted" << endl;
|
Serial << "deleted" << endl;
|
||||||
|
delete (it.second);
|
||||||
brokers.erase(it.first);
|
brokers.erase(it.first);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ MqttBroker::~MqttBroker()
|
|||||||
{
|
{
|
||||||
delete clients[0];
|
delete clients[0];
|
||||||
}
|
}
|
||||||
|
server.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
// private constructor used by broker only
|
// private constructor used by broker only
|
||||||
|
|||||||
Reference in New Issue
Block a user