From 49652b9e2882a1c3cd5203ea91f90cdd32a090e9 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 27 Jul 2013 14:21:46 +0200 Subject: Some changes in memory management --- mmss/iface.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'mmss/iface.cpp') 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) { 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, const std::shared_ptr &net, const std::string &name, const gmrf_addr_t *address) { @@ -50,8 +48,8 @@ void add_iface(const std::shared_ptr &node, const std::shared_ptrname = 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); -- cgit v1.2.3