diff options
author | Mauro Sardara <msardara+fdio@cisco.com> | 2018-02-26 16:58:35 +0100 |
---|---|---|
committer | Mauro Sardara <msardara+fdio@cisco.com> | 2018-02-26 16:58:35 +0100 |
commit | de35d6c871dd14591c62c880c0571a99bbd9b6c8 (patch) | |
tree | c441e90d9f7382ace8a7d9cc8026bc096cd14386 | |
parent | fac06d1485609520b6eabae2a5504eba8b91e5ef (diff) |
Fix deletion of pending interest after timeout.
Change-Id: Ie46025dff03eb859deb0dbb53238d687cf91860b
Signed-off-by: Mauro Sardara <msardara+fdio@cisco.com>
-rw-r--r-- | icnet/ccnx/icnet_ccnx_portal.cc | 6 |
1 files changed, 3 insertions, 3 deletions
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<Name, std::unique_ptr<PendingInterest>>::iterator it = pending_interest_hash_table_.find(name); if (it != pending_interest_hash_table_.end()) { - it->second->getOnTimeoutCallback()(*it->second->getInterest()); + std::unique_ptr<PendingInterest> 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); |