By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 2,086 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

question about boost::scoped_ptr

P: n/a
I have code:

boost::scoped_ptr< CSpectrograph > m_pSpectrograph;

....
m_pSpectrograph.reset( new CSpectrograph(init_data) );
....

But I found the CSpectrograph destructor never been called. What is
wrong?

Apr 12 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
kathy wrote:
I have code:

boost::scoped_ptr< CSpectrograph > m_pSpectrograph;

...
m_pSpectrograph.reset( new CSpectrograph(init_data) );
...

But I found the CSpectrograph destructor never been called. What is
wrong?


Why not use boost::shared_ptr? The first thing I did when installing boost
was write a test case demonstrating that boost::shared_ptr calls a
destructor.

BTW you have better odds of good answers on the Boost-User mailing list.
Fewer of us Boost here than there ;-)

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Apr 12 '06 #2

P: n/a
kathy wrote:
I have code:

boost::scoped_ptr< CSpectrograph > m_pSpectrograph;

...
m_pSpectrograph.reset( new CSpectrograph(init_data) );
...

But I found the CSpectrograph destructor never been called. What is
wrong?


Are you saying m_pSpectrograph has gone out of scope, and it's managed
CSpectrograph instance has not been destructed?

Jeff Flinn
Apr 12 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.