This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Destructor never gets called.


On Jun 11, 2001, "Liu, Guangsheng" <guangsheng.liu@intel.com> wrote:

> pthread_exit() exits itself.  After all the threads exit (t1, t2,
> main thread), I didn't see Class A's destructor being called.

pthread_exit() is not guaranteed to unwind the stack of the thread, so
destructors aren't called.  It only calls cleanup handlers, but
destructors of automatic objects aren't registered as such.  It's
debatable whether they should.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]