----Original Message---- >From: William M. (Mike) Miller >Sent: 09 May 2005 23:46
> I'm sure this is the result of my having done something stupid > with the setup application, but suddenly static destructors no > longer run. That is, for the following program: > > #include <stdio.h> > struct S { > S(); > ~S(); > } s; > S::S() { > printf("In ctor.\n"); > } > S::~S() { > printf("In dtor.\n"); > } > int main() { > printf("In main.\n"); > } > > the output is > > In ctor. > In main. > > The output "In dtor." is missing. That's because stdout is already closed by the time your dtor runs. I stepped right into it, it does the printf call but somewhere down in the dll it checks the flags field in the stdout FILE object for read/write and finds it's not open for either, so it's at eof. Grep 'cantwrite' if you really want to find it. Anyway, your dtor is called. cheers, DaveK -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/