
No one can help me ?
2007/5/8, Olivier Tournaire
m_rectangle is private of rectangle_with_profile
and defined as boost::shared_ptr m_rectangle; Thanks
2007/5/8, Manuel Jung < gzahl@arcor.de>:
Olivier Tournaire wrote:
Hi all,
I am trying to use shared_ptr in my code, but, I encoutered some problems. Here is a piece of my code :
The main :
boost::shared_ptr<OGRRectangle> rect( new OGRRectangle(5.,TPoint2D <double>(50.,20.),0.1325) ); boost::shared_ptr< rectangle_with_profile<OGRRectangle> > r( new rectangle_with_profile<OGRRectangle> ( rect , 5 , 12 , 1.5 , EXTREME) );
The rectangle_with_profile<T> constructor :
template <class Rect_class> rectangle_with_profile
::rectangle_with_profile( boost::shared_ptr rect , const unsigned int &nb_profiles , const unsigned int &nb_points , const double &distance , const eProfilePosition &position=CENTER ) { m_rectangle = rect; // ... // ... }
What is the Type of m_rectangle? It should be m_rectangle? If it isnt, this is maybe the problem (And it is of type scoped_ptr e.g.) Because than maybe the scoped_ptr would call the destructor. Could you post some more quellcode? Greetings Manuel Jung
Just after the line boost::shared_ptr< rectangle_with_profile<OGRRectangle> > r( new rectangle_with_profile<OGRRectangle> ( rect , 5 , 12 , 1.5 , EXTREME) ); the rect<T> destructor is called, and the m_rectangle in rectangle_with_profile handles a deleted pointer ...
What am I missing ?
Thanks in advance for your help.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Le temps des cerises reviendra. Dans l'immédiat, c'est le temps des noyaux. Courage.
-- Le temps des cerises reviendra. Dans l'immédiat, c'est le temps des noyaux. Courage.