From: <den...@us...> - 2010-07-12 15:34:57
|
Revision: 217 http://stdair.svn.sourceforge.net/stdair/?rev=217&view=rev Author: denis_arnaud Date: 2010-07-12 15:34:51 +0000 (Mon, 12 Jul 2010) Log Message: ----------- [Dev] Simplified (a little bit) the (Boost) shared pointer creation. Modified Paths: -------------- trunk/stdair/stdair/bom/BomIterator.hpp Modified: trunk/stdair/stdair/bom/BomIterator.hpp =================================================================== --- trunk/stdair/stdair/bom/BomIterator.hpp 2010-07-12 15:21:29 UTC (rev 216) +++ trunk/stdair/stdair/bom/BomIterator.hpp 2010-07-12 15:34:51 UTC (rev 217) @@ -10,7 +10,6 @@ #include <map> // BOOST #include <boost/shared_ptr.hpp> -#include <boost/make_shared.hpp> namespace stdair { @@ -126,8 +125,11 @@ CONTENT* lBomContent_ptr = BomStructure::getContentPtr<CONTENT> (*lBomStruct_ptr); assert (lBomContent_ptr != NULL); - - return boost::make_shared<value_type> (lKey, lBomContent_ptr); + + // The object (value_type) will be deleted when the caller will leave + // the scope from where that method is called. So, there is no memory + // leak thanks to the boost::shared_ptr around value_type. + return value_type_shared_ptr (new value_type (lKey, lBomContent_ptr)); } private: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |