From 1f99d4756af1be4d1bd1fc074c14462e426fbbc9 Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Sat, 18 Mar 2023 01:53:29 +0100 Subject: [PATCH] Fix: Sporadig crashes and reboot (#2366) * Fix: Sporadig crashes with reboot * Revert "Fix: Sporadig crashes with reboot" This reverts commit 59b65749f59b500fe8a6af6a20a993a70bd56b4f. * Fix: Sporadig crashes and reboot --- src/mesh/ReliableRouter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesh/ReliableRouter.cpp b/src/mesh/ReliableRouter.cpp index 774be9c17..7f5c9b7fc 100644 --- a/src/mesh/ReliableRouter.cpp +++ b/src/mesh/ReliableRouter.cpp @@ -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;