Implement MeshModule destructor (#5714)

This commit is contained in:
Eric Severance 2025-01-01 17:25:01 -08:00 committed by GitHub
parent c2c06ed0ad
commit 9f32995d7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,6 +4,7 @@
#include "NodeDB.h" #include "NodeDB.h"
#include "configuration.h" #include "configuration.h"
#include "modules/RoutingModule.h" #include "modules/RoutingModule.h"
#include <algorithm>
#include <assert.h> #include <assert.h>
std::vector<MeshModule *> *MeshModule::modules; std::vector<MeshModule *> *MeshModule::modules;
@ -29,7 +30,9 @@ void MeshModule::setup() {}
MeshModule::~MeshModule() MeshModule::~MeshModule()
{ {
assert(0); // FIXME - remove from list of modules once someone needs this feature auto it = std::find(modules->begin(), modules->end(), this);
assert(it != modules->end());
modules->erase(it);
} }
meshtastic_MeshPacket *MeshModule::allocAckNak(meshtastic_Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex, meshtastic_MeshPacket *MeshModule::allocAckNak(meshtastic_Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex,