Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Problem with Si...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 9 Topic 43837 of 48020
Post > Topic >>

Problem with Singleton and auto_ptr

by Soumen <soumen78@[EMAIL PROTECTED] > Mar 12, 2008 at 07:02 AM

Hi,

I've implemented singleton in one of my project. The way my command
works is user issues
the command and when the command finishes it object gets destroyed.
Singleton is required
to make sure when the command is running, user shouldn't be able to
invoke it again since
this is a GUI application. And my top level class uses auto_ptr. The
interesting part is it always
crashes in the 2nd invocation (after the 1st one is complete) - some
sort of pointer corruption.
 If I remove the static pointer for singleton implementation (i.e.
remove the singleton implementation)
itself or change the auto_ptr to normal pointers everything works
fine. I made sure that there's no
transfer of owner****p for auto_ptr objects.

Any clue what could be going wrong?

Regards,
~ Soumen
 




 9 Posts in Topic:
Problem with Singleton and auto_ptr
Soumen <soumen78@[EMAI  2008-03-12 07:02:02 
Re: Problem with Singleton and auto_ptr
ppi <vodoom@[EMAIL PRO  2008-03-12 07:23:14 
Re: Problem with Singleton and auto_ptr
Soumen <soumen78@[EMAI  2008-03-14 06:35:41 
Re: Problem with Singleton and auto_ptr
Goedson Paixao <goedso  2008-03-14 06:57:53 
Re: Problem with Singleton and auto_ptr
Soumen <soumen78@[EMAI  2008-03-14 07:18:19 
Re: Problem with Singleton and auto_ptr
Soumen <soumen78@[EMAI  2008-03-14 07:25:26 
Re: Problem with Singleton and auto_ptr
Martin York <Martin.Yo  2008-03-14 12:18:28 
Re: Problem with Singleton and auto_ptr
Martin York <Martin.Yo  2008-03-14 12:23:19 
Re: Problem with Singleton and auto_ptr
Soumen <soumen78@[EMAI  2008-03-17 00:29:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 14 8:39:57 CDT 2008.