GetSubNodes
is returning a vector by value. So you get a different copy of the vector every time you call it. The iterator you are getting from this copy is invalid when the copy is destroyed, which happens by the end of the statement. Return the vector by reference instead.
const std::vector<shared_ptr<FSNode>> & FSNode::GetSubNodes()
///////////////////////////////////// ^
{
return subNodes_;
}