mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-22 13:04:53 +00:00
Implement MeshModule destructor (#5714)
This commit is contained in:
parent
c2c06ed0ad
commit
9f32995d7f
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user