summaryrefslogtreecommitdiffstats
path: root/mmss/iface.cpp
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-07-27 14:21:46 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-07-27 14:21:46 +0200
commit49652b9e2882a1c3cd5203ea91f90cdd32a090e9 (patch)
tree81bedb0a0eda97edfab1d34cc93035780b7bbb74 /mmss/iface.cpp
parenta7ccec3fefe1c01cf238a3c0931459a54c2ff3a3 (diff)
downloadgmrf-49652b9e2882a1c3cd5203ea91f90cdd32a090e9.tar
gmrf-49652b9e2882a1c3cd5203ea91f90cdd32a090e9.zip
Some changes in memory management
Diffstat (limited to 'mmss/iface.cpp')
-rw-r--r--mmss/iface.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/mmss/iface.cpp b/mmss/iface.cpp
index f54c1ea..38808f1 100644
--- a/mmss/iface.cpp
+++ b/mmss/iface.cpp
@@ -37,11 +37,9 @@ void dispatch(const std::shared_ptr<packet_t> &packet) {
if (!source || !dest)
return;
- auto node = dest->node.lock();
- if (!node)
- return;
+ node_t *node = dest->node;
- node->proto->handle_packet(node.get(), node->ctx, dest.get(), &source->address, packet->data.get(), packet->len);
+ node->proto->handle_packet(node, node->ctx, dest.get(), &source->address, packet->data.get(), packet->len);
}
void add_iface(const std::shared_ptr<node_t> &node, const std::shared_ptr<network_t> &net, const std::string &name, const gmrf_addr_t *address) {
@@ -50,8 +48,8 @@ void add_iface(const std::shared_ptr<node_t> &node, const std::shared_ptr<networ
iface->name = name;
iface->address = *address;
- iface->node = node;
- iface->net = net;
+ iface->node = node.get();
+ iface->net = net.get();
node->interfaces.push_back(iface);
net->interfaces.push_back(iface);