fixed crash. missing AddRef()

pull/40/head
Matchman Green 2012-05-06 23:30:14 +08:00
parent c00ffef6a3
commit 6ad573942a
3 changed files with 3 additions and 3 deletions

View File

@ -183,7 +183,7 @@ Node::iterator::iterator( ImplVec::iterator it ) : m_it( it )
Node::iterator::value_type Node::iterator::operator*() const
{
return Node( *m_it ) ;
return Node( (*m_it)->AddRef() ) ;
}
Node::iterator Node::iterator::operator++()

View File

@ -89,6 +89,7 @@ public :
ImplVec::iterator m_it ;
} ;
private :
explicit Node( Impl *impl ) ;

View File

@ -61,7 +61,7 @@ void NodeTest::TestParseFile( )
CPPUNIT_ASSERT_EQUAL( std::string("q"), n["entry"]["link"]["@href"].Value() ) ;
CPPUNIT_ASSERT_EQUAL( Node::element, n["entry"]["link"]["href"].GetType() ) ;
CPPUNIT_ASSERT_EQUAL( std::string("abc"), n["entry"]["link"]["href"].Value() ) ;
/*
Node el = n["entry"]["link"] ;
Node::iterator i = el.begin() ;
while ( i != el.end() )
@ -69,7 +69,6 @@ void NodeTest::TestParseFile( )
CPPUNIT_ASSERT_EQUAL( std::string("href"), (*i).Name() ) ;
++i ;
}
*/
}
} // end of namespace grut