Christopher Faylor: > Andrew West: >>O.k. I'll check out the changes on Monday, but one minor point. >>Shouldn't the atexit stuff be run after all the destructors have run? > > Not if the output from the linux version of your program is to be > believed. I originally had the atexit stuff run after the dtors and saw > this: > > testlib:: stop > TestClass::~TestClass() > > Putting the atexit stuff first reversed the order, making it match > linux.
The C++ standard requires static destructors and atexit functions to be executed in the opposite order that the corresponding constructors were invoked and the atexit functions were registered. Since atexit() may be called from static constructors, there should theoretically be a single stack for destructors and atexit functions. But if that's not practical, invoking the atexit stuff first is a fairly decent approximation. Andy -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple