table: NameTree::getEntry
NameTree::get is renamed to NameTree::lookup.
NameTree::getEntry is introduced to return the NameTreeEntry on which a table entry is attached.
tableEntry::m_nameTreeEntry is changed to weak_ptr to avoid circular shared_ptr reference.
refs #3608, #3619
Change-Id: I425b6a2eb5fe3024bbaff4ff766eb6739be54b02
diff --git a/daemon/table/pit.cpp b/daemon/table/pit.cpp
index ae5a5cd..7286cbe 100644
--- a/daemon/table/pit.cpp
+++ b/daemon/table/pit.cpp
@@ -113,8 +113,8 @@
void
Pit::erase(shared_ptr<pit::Entry> pitEntry)
{
- shared_ptr<name_tree::Entry> nameTreeEntry = pitEntry->m_nameTreeEntry;
- BOOST_ASSERT(static_cast<bool>(nameTreeEntry));
+ shared_ptr<name_tree::Entry> nameTreeEntry = m_nameTree.getEntry(*pitEntry);
+ BOOST_ASSERT(nameTreeEntry != nullptr);
nameTreeEntry->erasePitEntry(pitEntry);
m_nameTree.eraseEntryIfEmpty(nameTreeEntry);