Trying todo a simple on a vector of shared_ptr and it crashes? I am suspecting I am doing something obviously wrong?
std::vector< shared_ptr<SUBCLASS> > m_vecSections;
shared_ptr<SUBCLASS> hoodSection;
BOOST_FOREACH(hoodSection, m_vecSections ){
//do something
}
I am getting a crash in
void add_ref_copy()
{
atomic_increment( &use_count_ );
}
Thankyou guys
You had no chance to find it, a call like this…
weak_ptr weakHood(shared_ptr(this));
released the m_vecSections and caused the crash…