From de35d6c871dd14591c62c880c0571a99bbd9b6c8 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Mon, 26 Feb 2018 16:58:35 +0100 Subject: Fix deletion of pending interest after timeout. Change-Id: Ie46025dff03eb859deb0dbb53238d687cf91860b Signed-off-by: Mauro Sardara --- icnet/ccnx/icnet_ccnx_portal.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'icnet') diff --git a/icnet/ccnx/icnet_ccnx_portal.cc b/icnet/ccnx/icnet_ccnx_portal.cc index c13a2e58..eeb19360 100644 --- a/icnet/ccnx/icnet_ccnx_portal.cc +++ b/icnet/ccnx/icnet_ccnx_portal.cc @@ -70,11 +70,11 @@ void Portal::sendInterest(const Interest &interest, if (ec.value() != boost::system::errc::operation_canceled) { std::unordered_map>::iterator it = pending_interest_hash_table_.find(name); if (it != pending_interest_hash_table_.end()) { - it->second->getOnTimeoutCallback()(*it->second->getInterest()); + std::unique_ptr ptr = std::move(it->second); + pending_interest_hash_table_.erase(it); + ptr->getOnTimeoutCallback()(*ptr->getInterest()); } } - - pending_interest_hash_table_.erase(name); }; pend_interest->startCountdown(timer_callback); -- cgit 1.2.3-korg