rename NodeList::GetNode to NodeList::PeekNode to avoid memory leaks. Call Dispose from NodeListPriv::~NodeListPriv

This commit is contained in:
Mathieu Lacage
2007-05-02 13:59:29 +02:00
parent acf2d25cd5
commit 1893fea2ea
5 changed files with 8 additions and 14 deletions

View File

@@ -69,6 +69,7 @@ NodeListPriv::~NodeListPriv ()
i != m_nodes.end (); i++)
{
Node *node = *i;
node->Dispose ();
node->Unref ();
}
m_nodes.erase (m_nodes.begin (), m_nodes.end ());
@@ -94,13 +95,6 @@ NodeListPriv::End (void)
{
return m_nodes.end ();
}
Node *
NodeListPriv::GetNode (uint32_t n)
{
Node *node = m_nodes[n];
node->Ref ();
return node;
}
uint32_t
NodeListPriv::GetNNodes (void)
{
@@ -153,9 +147,9 @@ NodeList::CreateTraceResolver (TraceContext const &context)
return SimulationSingleton<NodeListPriv>::Get ()->CreateTraceResolver (context);
}
Node *
NodeList::GetNode (uint32_t n)
NodeList::PeekNode (uint32_t n)
{
return SimulationSingleton<NodeListPriv>::Get ()->GetNode (n);
return SimulationSingleton<NodeListPriv>::Get ()->PeekNode (n);
}