Fix: Sporadig crashes with reboot

This commit is contained in:
Manuel Verch 2023-03-17 22:40:08 +01:00
parent 7bbfa48b5d
commit 59b65749f5
2 changed files with 8 additions and 7 deletions

View File

@ -2,8 +2,9 @@
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"ms-vscode.cpptools",
"platformio.platformio-ide",
"trunk.io"
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

View File

@ -164,13 +164,13 @@ bool ReliableRouter::stopRetransmission(GlobalPacketId key)
{
auto old = findPendingPacket(key);
if (old) {
auto p = old->packet;
auto numErased = pending.erase(key);
assert(numErased == 1);
// remove the 'original' (identified by originator and packet->id) from the txqueue and free it
cancelSending(getFrom(old->packet), old->packet->id);
// now free the pooled copy for retransmission too. tryfix for #2228
if (old->packet)
packetPool.release(old->packet);
cancelSending(getFrom(p), p->id);
// now free the pooled copy for retransmission too
packetPool.release(p);
return true;
} else
return false;