From 829e0b6e26becccc3109f43c16e104d486188027 Mon Sep 17 00:00:00 2001 From: geeksville Date: Mon, 25 May 2020 08:19:14 -0700 Subject: [PATCH] fix extra free --- src/mesh/MeshService.cpp | 5 +---- src/mesh/RadioLibInterface.cpp | 1 - src/mesh/Router.h | 4 ++++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index 540ca7cb1..5060851c3 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -247,10 +247,7 @@ void MeshService::sendToMesh(MeshPacket *p) } // Note: We might return !OK if our fifo was full, at that point the only option we have is to drop it - if (router.sendLocal(p) != ERRNO_OK) { - DEBUG_MSG("No radio was able to send packet, discarding...\n"); - releaseToPool(p); - } + router.sendLocal(p); } void MeshService::sendNetworkPing(NodeNum dest, bool wantReplies) diff --git a/src/mesh/RadioLibInterface.cpp b/src/mesh/RadioLibInterface.cpp index 44bcc0413..53f99aae9 100644 --- a/src/mesh/RadioLibInterface.cpp +++ b/src/mesh/RadioLibInterface.cpp @@ -1,6 +1,5 @@ #include "RadioLibInterface.h" #include "MeshTypes.h" -#include "OSTimer.h" #include "mesh-pb-constants.h" #include #include diff --git a/src/mesh/Router.h b/src/mesh/Router.h index 45f0b762c..6903b7d4e 100644 --- a/src/mesh/Router.h +++ b/src/mesh/Router.h @@ -48,6 +48,8 @@ class Router /** * Works like send, but if we are sending to the local node, we directly put the message in the receive queue + * + * NOTE: This method will free the provided packet (even if we return an error code) */ ErrorCode sendLocal(MeshPacket *p); @@ -63,6 +65,8 @@ class Router * Send a packet on a suitable interface. This routine will * later free() the packet to pool. This routine is not allowed to stall. * If the txmit queue is full it might return an error + * + * NOTE: This method will free the provided packet (even if we return an error code) */ virtual ErrorCode send(MeshPacket *p);