From: g0dil Date: Fri, 20 Feb 2009 23:22:41 +0000 (+0000) Subject: Utils/Console: Reset GenericNode::parent_ when destroying parent X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=c60d49c7a219b1069c2ce1abc4a0971a9f4ff1f4;p=senf.git Utils/Console: Reset GenericNode::parent_ when destroying parent git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1132 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Utils/Console/Node.cc b/Utils/Console/Node.cc index 5096ba8..41c1779 100644 --- a/Utils/Console/Node.cc +++ b/Utils/Console/Node.cc @@ -102,6 +102,14 @@ prefix_ void senf::console::LinkNode::v_help(std::ostream & os) /////////////////////////////////////////////////////////////////////////// //senf::console::DirectoryNode +prefix_ senf::console::DirectoryNode::~DirectoryNode() +{ + ChildMap::iterator i (children_.begin()); + ChildMap::iterator const i_end (children_.end()); + for (; i != i_end; ++i) + i->second->parent_ = 0; +} + prefix_ senf::console::GenericNode::ptr senf::console::DirectoryNode::remove(std::string const & name) { diff --git a/Utils/Console/Node.hh b/Utils/Console/Node.hh index 0367f5a..fcd44d0 100644 --- a/Utils/Console/Node.hh +++ b/Utils/Console/Node.hh @@ -436,6 +436,7 @@ namespace console { static ptr create(); ///< Create node object. /**< You should normally use either mkdir() or ScopedDirectory instead of create() */ + ~DirectoryNode(); ///\} ///////////////////////////////////////////////////////////////////////////